Skip to content

Commit 44b731b

Browse files
committed
Fix update document test after update to v0.29
1 parent 37bf3e6 commit 44b731b

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

tests/index/test_index_document_meilisearch.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# pylint: disable=invalid-name
22

33
from math import ceil
4+
from time import sleep
45
from meilisearch.client import Client
56
from meilisearch.models.document import Document
67
from meilisearch.models.task import TaskInfo
@@ -91,17 +92,23 @@ def test_update_documents(index_with_documents, small_movies):
9192
"""Tests updating a single document and a set of documents."""
9293
index = index_with_documents()
9394
response = index.get_documents()
94-
response.results[0].title = 'Some title'
95-
update = index.update_documents([dict(response.results[0])])
95+
doc = response.results[0]
96+
doc.title = 'Some title'
97+
98+
update = index.update_documents([dict(doc)])
99+
96100
assert isinstance(update, TaskInfo)
97101
assert update.task_uid != None
98102
index.wait_for_task(update.task_uid)
99-
response = index.get_documents()
100-
assert response.results[0].title == 'Some title'
103+
104+
response = index.get_document(doc.id)
105+
assert response.title == 'Some title'
106+
101107
update = index.update_documents(small_movies)
102108
index.wait_for_task(update.task_uid)
103-
response = index.get_documents()
104-
assert response.results[0].title != 'Some title'
109+
110+
response = index.get_document(doc.id)
111+
assert response.title != 'Some title'
105112

106113
@pytest.mark.parametrize('batch_size', [2, 3, 1000])
107114
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)