@@ -197,14 +197,18 @@ def test_add_documents_csv(empty_index, songs_csv):
197
197
assert index .get_primary_key () == "id"
198
198
199
199
200
- def test_add_documents_csv_with_delimiter (empty_index , songs_csv_delimiter ):
200
+ def test_add_documents_csv_with_delimiter (empty_index , songs_csv_custom_separator ):
201
201
"""Tests adding new documents to a clean index."""
202
202
index = empty_index ("csv-delimiter" )
203
- response = index .add_documents_csv (songs_csv_delimiter , csv_delimiter = ";" )
203
+ response = index .add_documents_csv (songs_csv_custom_separator , csv_delimiter = ";" )
204
204
assert isinstance (response , TaskInfo )
205
205
assert response .task_uid is not None
206
206
task = index .wait_for_task (response .task_uid )
207
207
assert task .status == "succeeded"
208
+ assert task .details ["receivedDocuments" ] == 53
209
+ documents = index .get_documents ().results
210
+ assert documents [1 ].country == "Europe"
211
+ assert documents [4 ].artist == "Elton John"
208
212
209
213
210
214
def test_update_documents_csv (index_with_documents , songs_csv ):
@@ -218,14 +222,18 @@ def test_update_documents_csv(index_with_documents, songs_csv):
218
222
assert index .get_primary_key () == "id"
219
223
220
224
221
- def test_update_documents_csv_with_delimiter (index_with_documents , songs_csv_delimiter ):
225
+ def test_update_documents_csv_with_delimiter (index_with_documents , songs_csv_custom_separator ):
222
226
"""Tests adding new documents to a clean index."""
223
- index = index_with_documents ("csv-delimiter" )
224
- response = index .update_documents_csv (songs_csv_delimiter , csv_delimiter = ";" )
227
+ index = index_with_documents ()
228
+ response = index .update_documents_csv (songs_csv_custom_separator , csv_delimiter = ";" )
225
229
assert isinstance (response , TaskInfo )
226
230
assert response .task_uid is not None
227
231
task = index .wait_for_task (response .task_uid )
228
232
assert task .status == "succeeded"
233
+ assert task .details ["receivedDocuments" ] == 53
234
+ document = index .get_document ("813645611" )
235
+ assert document .country == "Europe"
236
+ assert document .artist == "Elton John"
229
237
230
238
231
239
def test_add_documents_json (empty_index , small_movies_json_file ):
0 commit comments