This is an automated email from the ASF dual-hosted git repository.

eladkal pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 56ca940567 Fix pinecone PINECONE_DEBUG_CURL unit test (#41703)
56ca940567 is described below

commit 56ca940567fd7aa9977e7047c495bb5bc9face12
Author: Niko Oliveira <[email protected]>
AuthorDate: Fri Aug 23 20:43:27 2024 -0700

    Fix pinecone PINECONE_DEBUG_CURL unit test (#41703)
    
    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.
---
 tests/providers/pinecone/hooks/test_pinecone.py | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/tests/providers/pinecone/hooks/test_pinecone.py 
b/tests/providers/pinecone/hooks/test_pinecone.py
index 82a01e5319..1bd80b7a27 100644
--- a/tests/providers/pinecone/hooks/test_pinecone.py
+++ b/tests/providers/pinecone/hooks/test_pinecone.py
@@ -52,11 +52,9 @@ class TestPineconeHook:
         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")

Reply via email to