Example #1
0
 def test_create_or_update_datasource(self, api_key, endpoint, index_name, **kwargs):
     client = SearchIndexerClient(endpoint, AzureKeyCredential(api_key))
     data_source_connection = self._create_data_source_connection()
     created = client.create_data_source_connection(data_source_connection)
     assert len(client.get_data_source_connections()) == 1
     data_source_connection.description = "updated"
     client.create_or_update_data_source_connection(data_source_connection)
     assert len(client.get_data_source_connections()) == 1
     result = client.get_data_source_connection("sample-datasource")
     assert result.name == "sample-datasource"
     assert result.description == "updated"
Example #2
0
 def test_get_datasource(self, api_key, endpoint, index_name, **kwargs):
     client = SearchIndexerClient(endpoint, AzureKeyCredential(api_key))
     data_source_connection = self._create_data_source_connection()
     created = client.create_data_source_connection(data_source_connection)
     result = client.get_data_source_connection("sample-datasource")
     assert result.name == "sample-datasource"