mik-laj commented on a change in pull request #5958: [AIRFLOW-5335] Simplify 
GCSHook test
URL: https://github.com/apache/airflow/pull/5958#discussion_r319404273
 
 

 ##########
 File path: tests/contrib/hooks/test_gcs_hook.py
 ##########
 @@ -71,10 +71,11 @@ def setUp(self):
             self.gcs_hook = gcs_hook.GoogleCloudStorageHook(
                 google_cloud_storage_conn_id='test')
 
-    def test_storage_client_creation(self):
+    @mock.patch(BASE_STRING.format("GoogleCloudBaseHook._get_credentials"))
+    def test_storage_client_creation(self, get_con_mock):
+        get_con_mock.return_value = mock.ANY
         with mock.patch('google.cloud.storage.Client') as mock_client:
-            gcs_hook_1 = gcs_hook.GoogleCloudStorageHook()
-            gcs_hook_1.get_conn()
+            gcs_hook.GoogleCloudStorageHook().get_conn()
 
             # test that Storage Client is called with required arguments
             mock_client.assert_called_once_with(
 
 Review comment:
   ```suggestion
               mock_client.assert_called_once_with(
               credentials ="CREDENTIALS"
   ```
   Checking if the marker has been passed.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to