Test collection operations with metadata schema
(stub)
| 150 | |
| 151 | |
| 152 | def 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 | |
| 184 | def run_all_tests(): |
no test coverage detected