Skip to content

Commit

Permalink
Lint: Fix lint formatting issues from the master branch
Browse files Browse the repository at this point in the history
  • Loading branch information
yeounhak committed Nov 29, 2024
1 parent 4ac0e6a commit 68f11c9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
11 changes: 6 additions & 5 deletions libs/community/tests/unit_tests/document_loaders/test_mongodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,12 @@ async def test_load_mocked_with_filters(expected_documents: List[Document]) -> N
mock_collection.find = mock_find
mock_collection.count_documents = mock_count_documents

with patch(
"motor.motor_asyncio.AsyncIOMotorClient", return_value=MagicMock()
), patch(
"langchain_community.document_loaders.mongodb.MongodbLoader.aload",
new=mock_async_load,
with (
patch("motor.motor_asyncio.AsyncIOMotorClient", return_value=MagicMock()),
patch(
"langchain_community.document_loaders.mongodb.MongodbLoader.aload",
new=mock_async_load,
),
):
loader = MongodbLoader(
"mongodb://localhost:27017",
Expand Down
11 changes: 6 additions & 5 deletions libs/community/tests/unit_tests/tools/audio/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,12 @@ def test_huggingface_tts_constructor() -> None:
def test_huggingface_tts_run_with_requests_mock() -> None:
os.environ["HUGGINGFACE_API_KEY"] = "foo"

with tempfile.TemporaryDirectory() as tmp_dir, patch(
"uuid.uuid4"
) as mock_uuid, patch("requests.post") as mock_inference, patch(
"builtins.open", mock_open()
) as mock_file:
with (
tempfile.TemporaryDirectory() as tmp_dir,
patch("uuid.uuid4") as mock_uuid,
patch("requests.post") as mock_inference,
patch("builtins.open", mock_open()) as mock_file,
):
input_query = "Dummy input"

mock_uuid_value = uuid.UUID("00000000-0000-0000-0000-000000000000")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,10 @@ def mock_upload_documents(self, documents: List[object]) -> List[Response]: # t
]
ids_provided = [i.metadata.get("id") for i in documents]

with patch.object(
SearchClient, "upload_documents", mock_upload_documents
), patch.object(SearchIndexClient, "get_index", mock_default_index):
with (
patch.object(SearchClient, "upload_documents", mock_upload_documents),
patch.object(SearchIndexClient, "get_index", mock_default_index),
):
vector_store = create_vector_store()
ids_used_at_upload = vector_store.add_documents(documents, ids=ids_provided)
assert len(ids_provided) == len(ids_used_at_upload)
Expand Down

0 comments on commit 68f11c9

Please sign in to comment.