Skip to content

Commit

Permalink
test fix (#13035)
Browse files Browse the repository at this point in the history
* test fix

* test fix

* fix
  • Loading branch information
xiangyan99 authored Aug 11, 2020
1 parent 574c20c commit 9af36f1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ async def flush(self, raise_error=False):
# get actions
actions = await self._index_documents_batch.dequeue_actions()
try:
results = self._index_documents_actions(actions=actions)
results = await self._index_documents_actions(actions=actions)
# re-queue 207:
if not self._index_key:
client = SearchServiceClient(self._endpoint)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ async def test_failed_queue(self):


@mock.patch(
"azure.search.documents._internal._search_index_document_batching_client.SearchIndexDocumentBatchingClient.flush"
"azure.search.documents._internal.aio._search_index_document_batching_client_async.SearchIndexDocumentBatchingClient.flush"
)
async def test_flush_if_needed(self, mock_flush):
client = SearchIndexDocumentBatchingClient("endpoint", "index name", CREDENTIAL, window=1000, batch_size=2)
Expand All @@ -78,9 +78,9 @@ async def test_flush_if_needed(self, mock_flush):


@mock.patch(
"azure.search.documents._internal._search_index_document_batching_client.SearchIndexDocumentBatchingClient._cleanup"
"azure.search.documents._internal.aio._search_index_document_batching_client_async.SearchIndexDocumentBatchingClient._cleanup"
)
async def test_flush_if_needed(self, mock_cleanup):
async def test_context_manager(self, mock_cleanup):
async with SearchIndexDocumentBatchingClient("endpoint", "index name", CREDENTIAL) as client:
await client.add_upload_actions(["upload1"])
await client.add_delete_actions(["delete1", "delete2"])
Expand Down

0 comments on commit 9af36f1

Please sign in to comment.