Files
qdrant/openapi/tests/openapi_integration/test_alias.py
Andrey Vasnetsov f5feff8080 Validated integration tests - #232
* wip: re-implement http tests using openapi validation library

* collection delete api

* payload operations test

* payload delete operations test

* payload index creation and removing test

* uuid operations test

* schema consistency test

* add tests into pipeline

* chmod +x

* faster local runs with docker cache

* upd instruction
2022-02-11 16:43:47 +01:00

44 lines
1.1 KiB
Python

import pytest
from openapi_integration.helpers.helpers import request_with_validation
from openapi_integration.helpers.collection_setup import basic_collection_setup, drop_collection
collection_name = 'test_collection_alias'
@pytest.fixture(autouse=True)
def setup():
basic_collection_setup(collection_name=collection_name)
yield
drop_collection(collection_name=collection_name)
def test_alias_operations():
response = request_with_validation(
api='/collections/aliases',
method="POST",
body={
"actions": [
{
"create_alias": {
"alias_name": "test_alias",
"collection_name": collection_name
}
}
]
}
)
assert response.ok
response = request_with_validation(
api='/collections/{name}/points/search',
method="POST",
path_params={'name': "test_alias"},
body={
"vector": [0.2, 0.1, 0.9, 0.7],
"top": 3
}
)
assert response.ok
assert len(response.json()['result']) == 3