MCPcopy Create free account
hub / github.com/cosdata/cosdata / test_metadata_collection_operations

Function test_metadata_collection_operations

tests/test-grpc.py:152–181  ·  view source on GitHub ↗

Test collection operations with metadata schema

(stub)

Source from the content-addressed store, hash-verified

150
151
152def test_metadata_collection_operations(stub):
153 """Test collection operations with metadata schema"""
154 print("\n=== Testing Metadata Collection Operations ===")
155
156 print("\n1. Creating collection with metadata schema...")
157 try:
158 response = create_collection_with_metadata(stub)
159 print(f"Collection created successfully with metadata: {response}")
160 collection_id = response.id
161 except grpc.RpcError as e:
162 print(f"Failed to create collection with metadata: {e.details()}")
163 return False
164
165 print("\n2. Verifying collection with metadata...")
166 try:
167 response = get_collection(stub, collection_id)
168 print(f"Retrieved collection: {response}")
169 except grpc.RpcError as e:
170 print(f"Failed to verify collection: {e.details()}")
171 return False
172
173 print("\n3. Cleaning up metadata collection...")
174 try:
175 delete_collection(stub, collection_id)
176 print("Collection with metadata deleted successfully")
177 except grpc.RpcError as e:
178 print(f"Failed to delete collection: {e.details()}")
179 return False
180
181 return True
182
183
184def run_all_tests():

Callers 1

run_all_testsFunction · 0.85

Calls 3

get_collectionFunction · 0.85
delete_collectionFunction · 0.70

Tested by

no test coverage detected