Skip to content

GetMetadataFieldsInfoAsyncTest, GetMetadataFieldMinMaxAsyncTest, GetMetadataFieldUniqueValuesAsyncTest #10921

@davidsbatista

Description

@davidsbatista

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

Metadata

Metadata

Assignees

Labels

P2Medium priority, add to the next sprint if no P1 available

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions