-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
6 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,12 @@ | ||
# pylint: disable=invalid-name | ||
|
||
import pytest | ||
from tests import wait_for_dump_creation | ||
from meilisearch.errors import MeiliSearchApiError | ||
|
||
def test_dump_creation(client, index_with_documents): | ||
"""Tests the creation of a Meilisearch dump.""" | ||
index_with_documents("indexUID-dump-creation") | ||
dump = client.create_dump() | ||
assert dump['uid'] is not None | ||
assert dump['status'] == 'in_progress' | ||
wait_for_dump_creation(client, dump['uid']) | ||
|
||
def test_dump_status_route(client, index_with_documents): | ||
"""Tests the route for getting a Meilisearch dump status.""" | ||
index_with_documents("indexUID-dump-status") | ||
dump = client.create_dump() | ||
assert dump['uid'] is not None | ||
assert dump['status'] == 'in_progress' | ||
dump_status = client.get_dump_status(dump['uid']) | ||
assert dump_status['uid'] is not None | ||
assert dump_status['status'] is not None | ||
wait_for_dump_creation(client, dump['uid']) | ||
|
||
def test_dump_status_nonexistent_uid_raises_error(client): | ||
"""Tests the route for getting an inexistent dump status.""" | ||
with pytest.raises(MeiliSearchApiError): | ||
client.get_dump_status('uid_not_exists') | ||
assert dump['taskUid'] is not None | ||
assert dump['status'] == 'enqueued' | ||
client.wait_for_task(dump['taskUid']) | ||
dump_status = client.get_task(dump['taskUid']) | ||
assert dump_status['status'] == 'succeeded' | ||
assert dump_status['type'] == 'dumpCreation' |
This file was deleted.
Oops, something went wrong.