From f620aaf5f5c0c099555a156617d727a3ea7ccbd0 Mon Sep 17 00:00:00 2001 From: hsm207 Date: Tue, 5 Mar 2024 17:21:29 +0000 Subject: [PATCH] update test case due to latest client changes --- .../weaviate/tests/test_document_store.py | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/integrations/weaviate/tests/test_document_store.py b/integrations/weaviate/tests/test_document_store.py index a35d4d817..9abf0db27 100644 --- a/integrations/weaviate/tests/test_document_store.py +++ b/integrations/weaviate/tests/test_document_store.py @@ -155,8 +155,7 @@ def test_init(self, mock_weaviate_client_class, monkeypatch): monkeypatch.setenv("WEAVIATE_API_KEY", "my_api_key") WeaviateDocumentStore( collection_settings={"class": "My_collection"}, - # auth_client_secret=AuthApiKey(), - # proxies={"http": "http://proxy:1234"}, + auth_client_secret=AuthApiKey(), additional_headers={"X-HuggingFace-Api-Key": "MY_HUGGINGFACE_KEY"}, embedded_options=EmbeddedOptions( persistence_data_path=DEFAULT_PERSISTENCE_DATA_PATH, @@ -164,23 +163,16 @@ def test_init(self, mock_weaviate_client_class, monkeypatch): version="1.23.7", hostname="127.0.0.1", ), - # additional_config=AdditionalConfig( - # proxies={"http": "http://proxy:1234"}, - # ), + additional_config=AdditionalConfig( + proxies={"http": "http://proxy:1234"}, trust_env=False, timeout=(10, 60) + ), ) # Verify client is created with correct parameters mock_weaviate_client_class.assert_called_once_with( - # connection_params = connection_params, - # collection_settings={"class": "My_collection"}, - # auth_client_secret=WeaviateAuthApiKey("my_api_key"), - # timeout_config=(10, 60), - # proxies={"http": "http://proxy:1234"}, - # trust_env=False, + auth_client_secret=AuthApiKey().resolve_value(), connection_params=None, - auth_client_secret=None, - additional_config=None, additional_headers={"X-HuggingFace-Api-Key": "MY_HUGGINGFACE_KEY"}, embedded_options=EmbeddedOptions( persistence_data_path=DEFAULT_PERSISTENCE_DATA_PATH, @@ -189,6 +181,9 @@ def test_init(self, mock_weaviate_client_class, monkeypatch): hostname="127.0.0.1", ), skip_init_checks=False, + additional_config=AdditionalConfig( + proxies={"http": "http://proxy:1234"}, trust_env=False, timeout=(10, 60) + ), ) # Verify collection is created