Test basic collection operations without metadata
(stub)
| 107 | |
| 108 | |
| 109 | def test_basic_collection_operations(stub): |
| 110 | """Test basic collection operations without metadata""" |
| 111 | print("\n=== Testing Basic Collection Operations ===") |
| 112 | collection_name = "test_basic_collection" |
| 113 | |
| 114 | print("\n1. Creating basic collection...") |
| 115 | try: |
| 116 | response = create_simple_collection(stub, collection_name) |
| 117 | print(f"Collection created successfully: {response}") |
| 118 | except grpc.RpcError as e: |
| 119 | print(f"Failed to create collection: {e.details()}") |
| 120 | return False |
| 121 | |
| 122 | print("\n2. Getting all collections...") |
| 123 | try: |
| 124 | response = get_collections(stub) |
| 125 | print(f"Got collections successfully: {response}") |
| 126 | if not any(c.name == collection_name for c in response.collections): |
| 127 | print("Created collection not found in list!") |
| 128 | return False |
| 129 | except grpc.RpcError as e: |
| 130 | print(f"Failed to get collections: {e.details()}") |
| 131 | return False |
| 132 | |
| 133 | print("\n3. Getting specific collection...") |
| 134 | try: |
| 135 | response = get_collection(stub, collection_name) |
| 136 | print(f"Got collection successfully: {response}") |
| 137 | except grpc.RpcError as e: |
| 138 | print(f"Failed to get collection: {e.details()}") |
| 139 | return False |
| 140 | |
| 141 | print("\n4. Deleting collection...") |
| 142 | try: |
| 143 | delete_collection(stub, collection_name) |
| 144 | print("Collection deleted successfully") |
| 145 | except grpc.RpcError as e: |
| 146 | print(f"Failed to delete collection: {e.details()}") |
| 147 | return False |
| 148 | |
| 149 | return True |
| 150 | |
| 151 | |
| 152 | def test_metadata_collection_operations(stub): |
no test coverage detected