test_adx_9.py 758 B

123456789101112131415
  1. def test_run_query(self, mock_execute):
  2. mock_execute.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. hook = AzureDataExplorerHook(azure_data_explorer_conn_id=ADX_TEST_CONN_ID)
  12. hook.run_query('Database', 'Logs | schema', options={'option1': 'option_value'})
  13. properties = ClientRequestProperties()
  14. properties.set_option('option1', 'option_value')
  15. assert mock_execute.called_with('Database', 'Logs | schema', properties=properties)