-
Notifications
You must be signed in to change notification settings - Fork 2.7k
CountDocumentsAsyncTest, WriteDocumentsAsyncTest, WriteDocumentsAsyncTest #10917
Copy link
Copy link
Closed
Copy link
Labels
P1High priority, add to the next sprintHigh priority, add to the next sprint
Description
NOTES:
- Tests should be written into
haystack/testing/document_store_async.py - Use
async deffor all test methods - Decorate each test method with
@pytest.mark.asyncio - Rely on an
async-compatibledocument_storefixture (to be provided by the concrete test class in each integration) - Use
awaiton all*_async()calls - Use
write_documents_async/count_documents_asyncin setup steps (not the sync variants), so the full async path is exercised end-to-end - Open the PR to the async-mixin-tests feature branch
CountDocumentsAsyncTest
Mirrors: CountDocumentsTest
| Test | Description |
|---|---|
test_count_empty_async |
await count_documents_async() returns 0 on empty store |
test_count_not_empty_async |
After writing 3 docs via write_documents_async, count_documents_async() returns 3 |
WriteDocumentsAsyncTest(AssertDocumentsEqualMixin)
Mirrors: WriteDocumentsTest
| Test | Description |
|---|---|
test_write_documents_async |
Abstract — raise NotImplementedError with a message; concrete classes must override this |
test_write_documents_duplicate_fail_async |
Writing same doc twice with DuplicatePolicy.FAIL raises DuplicateDocumentError on second write |
test_write_documents_duplicate_skip_async |
Second write of same doc with DuplicatePolicy.SKIP returns 0 |
test_write_documents_duplicate_overwrite_async |
DuplicatePolicy.OVERWRITE updates content; verify via filter_documents_async |
test_write_documents_invalid_input_async |
Passing ["not a document"] or a plain string raises ValueError |
DeleteDocumentsAsyncTest
Mirrors: DeleteDocumentsTest
| Test | Description |
|---|---|
test_delete_documents_async |
Write 1 doc, delete it by id, count_documents_async() returns 0 |
test_delete_documents_empty_document_store_async |
delete_documents_async(["non_existing_id"]) on empty store doesn't raise |
test_delete_documents_non_existing_document_async |
Delete non-existing id from a 1-doc store; count stays at 1 |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P1High priority, add to the next sprintHigh priority, add to the next sprint