Skip to content

Commit f76dd93

Browse files
committed
test: create test add_documents empty string
ref: #585
1 parent ffa63f0 commit f76dd93

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/index/test_index_document_meilisearch.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@ def test_add_documents(empty_index, small_movies):
2525
assert index.get_primary_key() == "id"
2626
assert update.status == "succeeded"
2727

28+
def test_add_documents_empty(empty_index):
29+
"""Tests adding empty string as documents to a clean index."""
30+
index = empty_index()
31+
with pytest.raises(Exception) as e_info:
32+
response = index.add_documents('')
33+
assert e_info.value.message == "A json payload is missing."
34+
assert e_info.value.code == "missing_payload"
35+
assert e_info.value.type == "invalid_request"
36+
assert e_info.value.link == "https://docs.meilisearch.com/errors#missing_payload"
2837

2938
@pytest.mark.parametrize("batch_size", [2, 3, 1000])
3039
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)