def test_get_conn_with_credentials(self, mock_connection, mock_spc): mock_sdk_client = Mock() auth_sdk_client = AzureBaseHook(mock_sdk_client).get_conn() mock_spc.assert_called_once_with( client_id=mock_connection.return_value.login, secret=mock_connection.return_value.password, tenant=mock_connection.return_value.extra_dejson['tenantId'], ) mock_sdk_client.assert_called_once_with( credentials=mock_spc.return_value, subscription_id=mock_connection.return_value.extra_dejson['subscriptionId'], ) assert auth_sdk_client == mock_sdk_client.return_value