Skip to content

Commit

Permalink
Add more async tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tsmith023 committed Jun 6, 2024
1 parent b28ebbd commit f65a9cc
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions integration/test_collection_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,34 @@ async def test_fetch_objects(async_collection_factory: AsyncCollectionFactory) -
assert res.objects[0].properties["name"] == "John Doe"


@pytest.mark.asyncio
async def test_config_update(async_collection_factory: AsyncCollectionFactory) -> None:
collection = await async_collection_factory(
properties=[
Property(name="name", data_type=DataType.TEXT),
],
multi_tenancy_config=wvc.config.Configure.multi_tenancy(),
vectorizer_config=wvc.config.Configure.Vectorizer.none(),
)
await collection.config.update(
multi_tenancy_config=wvc.config.Reconfigure.multi_tenancy(
auto_tenant_activation=True,
auto_tenant_creation=True,
)
)


@pytest.mark.asyncio
async def test_config_add_property(async_collection_factory: AsyncCollectionFactory) -> None:
collection = await async_collection_factory(
properties=[
Property(name="name", data_type=DataType.TEXT),
],
vectorizer_config=wvc.config.Configure.Vectorizer.none(),
)
await collection.config.add_property(Property(name="age", data_type=DataType.INT))


@pytest.mark.asyncio
async def test_config_add_reference(async_collection_factory: AsyncCollectionFactory) -> None:
collection = await async_collection_factory(
Expand Down Expand Up @@ -109,6 +137,9 @@ async def test_aggregate(async_collection_factory: AsyncCollectionFactory) -> No
res = await collection.aggregate.over_all()
assert res.total_count == 2

res = await collection.aggregate.hybrid("John", alpha=0, object_limit=10)
assert res.total_count == 1


@pytest.mark.asyncio
async def test_iterator(async_collection_factory: AsyncCollectionFactory) -> None:
Expand Down

0 comments on commit f65a9cc

Please sign in to comment.