NOTES:
- Tests should be written into
haystack/testing/document_store_async.py
- Use
async def for all test methods
- Decorate each test method with
@pytest.mark.asyncio
- Rely on an
async-compatible document_store fixture (to be provided by the concrete test class in each integration)
- Use
await on all *_async() calls
- Use
write_documents_async / count_documents_async in 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
GetMetadataFieldsInfoAsyncTest
Mirrors: GetMetadataFieldsInfoTest
| Test |
Description |
test_get_metadata_fields_info_async |
After writing docs, returned dict contains expected field names and each has a "type" key |
test_get_metadata_fields_info_empty_collection_async |
Empty store returns {} |
GetMetadataFieldMinMaxAsyncTest
Mirrors: GetMetadataFieldMinMaxTest
| Test |
Description |
test_get_metadata_field_min_max_numeric_async |
Integer field, correct min/max |
test_get_metadata_field_min_max_float_async |
Float field, correct min/max (use pytest.approx) |
test_get_metadata_field_min_max_single_value_async |
Single doc: min == max |
test_get_metadata_field_min_max_empty_collection_async |
Empty store: {"min": None, "max": None} |
test_get_metadata_field_min_max_meta_prefix_async |
Field names with "meta." prefix are handled |
GetMetadataFieldUniqueValuesAsyncTest
Mirrors: GetMetadataFieldUniqueValuesTest
| Test |
Description |
test_get_metadata_field_unique_values_basic_async |
Returns correct set of unique values; inspects signature for search_term, from_/offset, size/limit params |
NOTES:
haystack/testing/document_store_async.pyasync deffor all test methods@pytest.mark.asyncioasync-compatibledocument_storefixture (to be provided by the concrete test class in each integration)awaiton all*_async()callswrite_documents_async/count_documents_asyncin setup steps (not the sync variants), so the full async path is exercised end-to-endGetMetadataFieldsInfoAsyncTestMirrors:
GetMetadataFieldsInfoTesttest_get_metadata_fields_info_async"type"keytest_get_metadata_fields_info_empty_collection_async{}GetMetadataFieldMinMaxAsyncTestMirrors:
GetMetadataFieldMinMaxTesttest_get_metadata_field_min_max_numeric_asynctest_get_metadata_field_min_max_float_asyncpytest.approx)test_get_metadata_field_min_max_single_value_asynctest_get_metadata_field_min_max_empty_collection_async{"min": None, "max": None}test_get_metadata_field_min_max_meta_prefix_async"meta."prefix are handledGetMetadataFieldUniqueValuesAsyncTestMirrors:
GetMetadataFieldUniqueValuesTesttest_get_metadata_field_unique_values_basic_asyncsearch_term,from_/offset,size/limitparams