test_adx_8.py 627 B

1234567891011121314
  1. def test_conn_method_aad_device(self, mock_init):
  2. mock_init.return_value = None
  3. db.merge_conn(
  4. Connection(
  5. conn_id=ADX_TEST_CONN_ID,
  6. conn_type='azure_data_explorer',
  7. host='https://help.kusto.windows.net',
  8. extra=json.dumps({'extra__azure_data_explorer__auth_method': 'AAD_DEVICE'}),
  9. )
  10. )
  11. AzureDataExplorerHook(azure_data_explorer_conn_id=ADX_TEST_CONN_ID)
  12. assert mock_init.called_with(
  13. KustoConnectionStringBuilder.with_aad_device_authentication('https://help.kusto.windows.net')
  14. )