mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-24 04:31:02 +02:00
Fixed tests
This commit is contained in:
parent
4ee15b163d
commit
b5b2958b7c
2 changed files with 44 additions and 8 deletions
|
|
@ -79,6 +79,9 @@ 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'
|
||||||
|
|
@ -130,6 +133,9 @@ 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'
|
||||||
|
|
@ -187,6 +193,9 @@ 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'
|
||||||
|
|
@ -495,6 +516,9 @@ 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'
|
||||||
|
|
@ -534,6 +558,9 @@ 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'
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,9 @@ 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'
|
||||||
|
|
@ -108,6 +111,9 @@ 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'
|
||||||
|
|
@ -164,6 +170,9 @@ 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