test_base_azure_3.py 671 B

123456789101112131415
  1. def test_get_conn_with_credentials(self, mock_connection, mock_spc):
  2. mock_sdk_client = Mock()
  3. auth_sdk_client = AzureBaseHook(mock_sdk_client).get_conn()
  4. mock_spc.assert_called_once_with(
  5. client_id=mock_connection.return_value.login,
  6. secret=mock_connection.return_value.password,
  7. tenant=mock_connection.return_value.extra_dejson['tenantId'],
  8. )
  9. mock_sdk_client.assert_called_once_with(
  10. credentials=mock_spc.return_value,
  11. subscription_id=mock_connection.return_value.extra_dejson['subscriptionId'],
  12. )
  13. assert auth_sdk_client == mock_sdk_client.return_value