Skip to content

Commit

Permalink
Fix pinecone PINECONE_DEBUG_CURL unit test (#41703)
Browse files Browse the repository at this point in the history
Previously the unit test was mocking too early and the code which sets
the env variable was not even running. Remove mocking and create client
only to ensure the env variable is being set.
  • Loading branch information
o-nikolas authored Aug 24, 2024
1 parent 4b42691 commit 56ca940
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tests/providers/pinecone/hooks/test_pinecone.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,9 @@ def test_list_indexes(self, mock_list_indexes):
self.pinecone_hook.list_indexes()
mock_list_indexes.assert_called_once()

@patch("airflow.providers.pinecone.hooks.pinecone.PineconeHook.list_indexes")
def test_debug_curl_setting(self, mock_list_indexes):
def test_debug_curl_setting(self):
"""Test that the PINECONE_DEBUG_CURL environment variable is set when initializing Pinecone Object."""
self.pinecone_hook.list_indexes()
mock_list_indexes.assert_called_once()
self.pinecone_hook.pinecone_client
assert os.environ.get("PINECONE_DEBUG_CURL") == "true"

@patch("airflow.providers.pinecone.hooks.pinecone.PineconeHook.create_index")
Expand Down

0 comments on commit 56ca940

Please sign in to comment.