1234567891011121314151617181920212223 |
- def test_conn_method_aad_creds(self, mock_init):
- mock_init.return_value = None
- db.merge_conn(
- Connection(
- conn_id=ADX_TEST_CONN_ID,
- conn_type='azure_data_explorer',
- login='client_id',
- password='client secret',
- host='https://help.kusto.windows.net',
- extra=json.dumps(
- {
- 'extra__azure_data_explorer__tenant': 'tenant',
- 'extra__azure_data_explorer__auth_method': 'AAD_CREDS',
- }
- ),
- )
- )
- AzureDataExplorerHook(azure_data_explorer_conn_id=ADX_TEST_CONN_ID)
- assert mock_init.called_with(
- KustoConnectionStringBuilder.with_aad_user_password_authentication(
- 'https://help.kusto.windows.net', 'client_id', 'client secret', 'tenant'
- )
- )
|