Skip to content

Fix collection test #341

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion tests/test_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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)
Expand Down
Loading