Skip to content

Fix update document test after update to v0.29 #520

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions tests/index/test_index_document_meilisearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,23 @@ def test_update_documents(index_with_documents, small_movies):
"""Tests updating a single document and a set of documents."""
index = index_with_documents()
response = index.get_documents()
response.results[0].title = 'Some title'
update = index.update_documents([dict(response.results[0])])
doc = response.results[0]
doc.title = 'Some title'

update = index.update_documents([dict(doc)])

assert isinstance(update, TaskInfo)
assert update.task_uid != None
index.wait_for_task(update.task_uid)
response = index.get_documents()
assert response.results[0].title == 'Some title'

response = index.get_document(doc.id)
assert response.title == 'Some title'

update = index.update_documents(small_movies)
index.wait_for_task(update.task_uid)
response = index.get_documents()
assert response.results[0].title != 'Some title'

response = index.get_document(doc.id)
assert response.title != 'Some title'

@pytest.mark.parametrize('batch_size', [2, 3, 1000])
@pytest.mark.parametrize(
Expand Down