Lee-W commented on code in PR #33991:
URL: https://github.com/apache/airflow/pull/33991#discussion_r1312533730


##########
tests/providers/microsoft/azure/hooks/test_azure_container_instance.py:
##########
@@ -110,3 +121,17 @@ def test_connection_failure(self, 
mock_container_groups_list):
         status, msg = self.hook.test_connection()
         assert status is False
         assert msg == "Authentication failed."
+
+    @patch("azure.common.credentials.ServicePrincipalCredentials")
+    
@patch("airflow.providers.microsoft.azure.hooks.container_instance.DefaultAzureCredential")
+    def test_get_conn_fallback_to_default_azure_credential(
+        self,
+        mock_default_azure_credential,
+        mock_service_pricipal_credential,
+        connection_without_login_password_tenant_id,
+    ):
+        hook = 
AzureContainerInstanceHook(azure_conn_id=connection_without_login_password_tenant_id.conn_id)
+        hook.get_conn()

Review Comment:
   Sure. I just check the return value is mocked client



##########
tests/providers/microsoft/azure/hooks/test_azure_container_instance.py:
##########
@@ -110,3 +121,17 @@ def test_connection_failure(self, 
mock_container_groups_list):
         status, msg = self.hook.test_connection()
         assert status is False
         assert msg == "Authentication failed."
+
+    @patch("azure.common.credentials.ServicePrincipalCredentials")
+    
@patch("airflow.providers.microsoft.azure.hooks.container_instance.DefaultAzureCredential")
+    def test_get_conn_fallback_to_default_azure_credential(
+        self,
+        mock_default_azure_credential,
+        mock_service_pricipal_credential,
+        connection_without_login_password_tenant_id,
+    ):
+        hook = 
AzureContainerInstanceHook(azure_conn_id=connection_without_login_password_tenant_id.conn_id)
+        hook.get_conn()

Review Comment:
   Sure. I just add checks to verify that the return value is mocked client



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to