From 08163352f9ea1805f2f0034d1cc84677623a2c5b Mon Sep 17 00:00:00 2001 From: Alex Petenchea Date: Thu, 25 Apr 2024 14:32:13 +0300 Subject: [PATCH] Distribute shards like properti cannot be empty --- tests/test_collection.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/test_collection.py b/tests/test_collection.py index 9d85e912..6b10ba00 100644 --- a/tests/test_collection.py +++ b/tests/test_collection.py @@ -209,7 +209,6 @@ def test_collection_management(db, bad_db, cluster): shard_count=2, shard_fields=["test_attr:"], replication_factor=1, - shard_like="", sync_replication=False, enforce_replication_factor=False, sharding_strategy="community-compat", @@ -236,6 +235,14 @@ def test_collection_management(db, bad_db, cluster): assert properties["computedValues"] == computed_values col.configure(computed_values=[]) + if cluster: + # Create distribute-shards-like collection + shard_like_name = col_name + "_shards_like" + shard_like_col = db.create_collection(name=shard_like_name, shard_like=col_name) + assert shard_like_col.properties()["shard_like"] == col_name + assert db.has_collection(shard_like_name) is True + assert db.delete_collection(shard_like_name, system=False) is True + # Test create duplicate collection with assert_raises(CollectionCreateError) as err: db.create_collection(col_name)