mirror of
https://github.com/qdrant/qdrant.git
synced 2026-07-23 11:11:00 -05:00
Collection name under test is equal to the test module name, without `.py` suffix. * Helps by debugging/tracing failed tests and find relevant logs lines in qdrant log files * Opens up a possibility to run tests in parallel, given that there are no data sharing between test modules Change details: * defined module scoped `collection_name` fixture in `conftest.py` * removed `collection_name` module variable * each test signature modified to declare the dependency to `collection_name` fixture * `@pytest.mark.parametrize` migrated to `@pytest-cases.parametrize` in cases when `collection_name` was used as the value
33 lines
1010 B
Python
33 lines
1010 B
Python
from .helpers.helpers import request_with_validation
|
|
|
|
|
|
# validate that malformed conditions raise a JsonSchema ValidationError
|
|
|
|
def test_malformed_condition(collection_name):
|
|
# Should raise a ValidationError because the condition key is not defined
|
|
# see https://github.com/qdrant/qdrant/issues/1664
|
|
# with pytest.raises(jsonschema.exceptions.ValidationError):
|
|
malformed_condition(collection_name)
|
|
|
|
|
|
def malformed_condition(collection_name):
|
|
request_with_validation(
|
|
api='/collections/{collection_name}/points/search',
|
|
method="POST",
|
|
path_params={'collection_name': collection_name},
|
|
body={
|
|
"vector": [0.2, 0.1, 0.9, 0.7],
|
|
"limit": 5,
|
|
"filter": {
|
|
"should": [
|
|
{
|
|
"undefined_condition_key": {
|
|
"key": "city"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"with_payload": True
|
|
}
|
|
)
|