mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-23 20:21:03 +02:00
Fixed tests
This commit is contained in:
parent
4ee15b163d
commit
b5b2958b7c
2 changed files with 44 additions and 8 deletions
|
|
@ -78,7 +78,10 @@ class TestQdrantDocEmbeddingsStorage(IsolatedAsyncioTestCase):
|
||||||
}
|
}
|
||||||
|
|
||||||
processor = Processor(**config)
|
processor = Processor(**config)
|
||||||
|
|
||||||
|
# Add collection to known_collections (simulates config push)
|
||||||
|
processor.known_collections[('test_user', 'test_collection')] = {}
|
||||||
|
|
||||||
# Create mock message with chunks and vectors
|
# Create mock message with chunks and vectors
|
||||||
mock_message = MagicMock()
|
mock_message = MagicMock()
|
||||||
mock_message.metadata.user = 'test_user'
|
mock_message.metadata.user = 'test_user'
|
||||||
|
|
@ -129,7 +132,10 @@ class TestQdrantDocEmbeddingsStorage(IsolatedAsyncioTestCase):
|
||||||
}
|
}
|
||||||
|
|
||||||
processor = Processor(**config)
|
processor = Processor(**config)
|
||||||
|
|
||||||
|
# Add collection to known_collections (simulates config push)
|
||||||
|
processor.known_collections[('multi_user', 'multi_collection')] = {}
|
||||||
|
|
||||||
# Create mock message with multiple chunks
|
# Create mock message with multiple chunks
|
||||||
mock_message = MagicMock()
|
mock_message = MagicMock()
|
||||||
mock_message.metadata.user = 'multi_user'
|
mock_message.metadata.user = 'multi_user'
|
||||||
|
|
@ -186,7 +192,10 @@ class TestQdrantDocEmbeddingsStorage(IsolatedAsyncioTestCase):
|
||||||
}
|
}
|
||||||
|
|
||||||
processor = Processor(**config)
|
processor = Processor(**config)
|
||||||
|
|
||||||
|
# Add collection to known_collections (simulates config push)
|
||||||
|
processor.known_collections[('vector_user', 'vector_collection')] = {}
|
||||||
|
|
||||||
# Create mock message with chunk having multiple vectors
|
# Create mock message with chunk having multiple vectors
|
||||||
mock_message = MagicMock()
|
mock_message = MagicMock()
|
||||||
mock_message.metadata.user = 'vector_user'
|
mock_message.metadata.user = 'vector_user'
|
||||||
|
|
@ -280,6 +289,9 @@ class TestQdrantDocEmbeddingsStorage(IsolatedAsyncioTestCase):
|
||||||
|
|
||||||
processor = Processor(**config)
|
processor = Processor(**config)
|
||||||
|
|
||||||
|
# Add collection to known_collections (simulates config push)
|
||||||
|
processor.known_collections[('new_user', 'new_collection')] = {}
|
||||||
|
|
||||||
# Create mock message
|
# Create mock message
|
||||||
mock_message = MagicMock()
|
mock_message = MagicMock()
|
||||||
mock_message.metadata.user = 'new_user'
|
mock_message.metadata.user = 'new_user'
|
||||||
|
|
@ -329,6 +341,9 @@ class TestQdrantDocEmbeddingsStorage(IsolatedAsyncioTestCase):
|
||||||
|
|
||||||
processor = Processor(**config)
|
processor = Processor(**config)
|
||||||
|
|
||||||
|
# Add collection to known_collections (simulates config push)
|
||||||
|
processor.known_collections[('error_user', 'error_collection')] = {}
|
||||||
|
|
||||||
# Create mock message
|
# Create mock message
|
||||||
mock_message = MagicMock()
|
mock_message = MagicMock()
|
||||||
mock_message.metadata.user = 'error_user'
|
mock_message.metadata.user = 'error_user'
|
||||||
|
|
@ -364,6 +379,9 @@ class TestQdrantDocEmbeddingsStorage(IsolatedAsyncioTestCase):
|
||||||
|
|
||||||
processor = Processor(**config)
|
processor = Processor(**config)
|
||||||
|
|
||||||
|
# Add collection to known_collections (simulates config push)
|
||||||
|
processor.known_collections[('cache_user', 'cache_collection')] = {}
|
||||||
|
|
||||||
# Create first mock message
|
# Create first mock message
|
||||||
mock_message1 = MagicMock()
|
mock_message1 = MagicMock()
|
||||||
mock_message1.metadata.user = 'cache_user'
|
mock_message1.metadata.user = 'cache_user'
|
||||||
|
|
@ -425,6 +443,9 @@ class TestQdrantDocEmbeddingsStorage(IsolatedAsyncioTestCase):
|
||||||
|
|
||||||
processor = Processor(**config)
|
processor = Processor(**config)
|
||||||
|
|
||||||
|
# Add collection to known_collections (simulates config push)
|
||||||
|
processor.known_collections[('dim_user', 'dim_collection')] = {}
|
||||||
|
|
||||||
# Create mock message with different dimension vectors
|
# Create mock message with different dimension vectors
|
||||||
mock_message = MagicMock()
|
mock_message = MagicMock()
|
||||||
mock_message.metadata.user = 'dim_user'
|
mock_message.metadata.user = 'dim_user'
|
||||||
|
|
@ -494,7 +515,10 @@ class TestQdrantDocEmbeddingsStorage(IsolatedAsyncioTestCase):
|
||||||
}
|
}
|
||||||
|
|
||||||
processor = Processor(**config)
|
processor = Processor(**config)
|
||||||
|
|
||||||
|
# Add collection to known_collections (simulates config push)
|
||||||
|
processor.known_collections[('utf8_user', 'utf8_collection')] = {}
|
||||||
|
|
||||||
# Create mock message with UTF-8 encoded text
|
# Create mock message with UTF-8 encoded text
|
||||||
mock_message = MagicMock()
|
mock_message = MagicMock()
|
||||||
mock_message.metadata.user = 'utf8_user'
|
mock_message.metadata.user = 'utf8_user'
|
||||||
|
|
@ -533,7 +557,10 @@ class TestQdrantDocEmbeddingsStorage(IsolatedAsyncioTestCase):
|
||||||
}
|
}
|
||||||
|
|
||||||
processor = Processor(**config)
|
processor = Processor(**config)
|
||||||
|
|
||||||
|
# Add collection to known_collections (simulates config push)
|
||||||
|
processor.known_collections[('decode_user', 'decode_collection')] = {}
|
||||||
|
|
||||||
# Create mock message with decode error
|
# Create mock message with decode error
|
||||||
mock_message = MagicMock()
|
mock_message = MagicMock()
|
||||||
mock_message.metadata.user = 'decode_user'
|
mock_message.metadata.user = 'decode_user'
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,10 @@ class TestQdrantGraphEmbeddingsStorage(IsolatedAsyncioTestCase):
|
||||||
}
|
}
|
||||||
|
|
||||||
processor = Processor(**config)
|
processor = Processor(**config)
|
||||||
|
|
||||||
|
# Add collection to known_collections (simulates config push)
|
||||||
|
processor.known_collections[('test_user', 'test_collection')] = {}
|
||||||
|
|
||||||
# Create mock message with entities and vectors
|
# Create mock message with entities and vectors
|
||||||
mock_message = MagicMock()
|
mock_message = MagicMock()
|
||||||
mock_message.metadata.user = 'test_user'
|
mock_message.metadata.user = 'test_user'
|
||||||
|
|
@ -107,7 +110,10 @@ class TestQdrantGraphEmbeddingsStorage(IsolatedAsyncioTestCase):
|
||||||
}
|
}
|
||||||
|
|
||||||
processor = Processor(**config)
|
processor = Processor(**config)
|
||||||
|
|
||||||
|
# Add collection to known_collections (simulates config push)
|
||||||
|
processor.known_collections[('multi_user', 'multi_collection')] = {}
|
||||||
|
|
||||||
# Create mock message with multiple entities
|
# Create mock message with multiple entities
|
||||||
mock_message = MagicMock()
|
mock_message = MagicMock()
|
||||||
mock_message.metadata.user = 'multi_user'
|
mock_message.metadata.user = 'multi_user'
|
||||||
|
|
@ -163,7 +169,10 @@ class TestQdrantGraphEmbeddingsStorage(IsolatedAsyncioTestCase):
|
||||||
}
|
}
|
||||||
|
|
||||||
processor = Processor(**config)
|
processor = Processor(**config)
|
||||||
|
|
||||||
|
# Add collection to known_collections (simulates config push)
|
||||||
|
processor.known_collections[('vector_user', 'vector_collection')] = {}
|
||||||
|
|
||||||
# Create mock message with entity having multiple vectors
|
# Create mock message with entity having multiple vectors
|
||||||
mock_message = MagicMock()
|
mock_message = MagicMock()
|
||||||
mock_message.metadata.user = 'vector_user'
|
mock_message.metadata.user = 'vector_user'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue