Skip to content

Commit dc0ec94

Browse files
committed
trying to fix tests
1 parent b12bf76 commit dc0ec94

2 files changed

Lines changed: 24 additions & 24 deletions

File tree

integrations/weaviate/tests/test_document_store.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -837,32 +837,32 @@ def test_delete_all_documents_excessive_batch_size(self, document_store, caplog)
837837

838838
def test_delete_by_filter(self, document_store):
839839
docs = [
840-
Document(content="Doc 1", meta={"category": "A"}),
841-
Document(content="Doc 2", meta={"category": "B"}),
842-
Document(content="Doc 3", meta={"category": "A"}),
840+
Document(content="Doc 1", meta={"category": "TypeA"}),
841+
Document(content="Doc 2", meta={"category": "TypeB"}),
842+
Document(content="Doc 3", meta={"category": "TypeA"}),
843843
]
844844
document_store.write_documents(docs)
845845
assert document_store.count_documents() == 3
846846

847-
# Delete documents with category="A"
847+
# Delete documents with category="TypeA"
848848
deleted_count = document_store.delete_by_filter(
849-
filters={"field": "meta.category", "operator": "==", "value": "A"}
849+
filters={"field": "meta.category", "operator": "==", "value": "TypeA"}
850850
)
851851
assert deleted_count == 2
852852
assert document_store.count_documents() == 1
853853

854854
def test_update_by_filter(self, document_store):
855855
docs = [
856-
Document(content="Doc 1", meta={"category": "A", "status": "draft"}),
857-
Document(content="Doc 2", meta={"category": "B", "status": "draft"}),
858-
Document(content="Doc 3", meta={"category": "A", "status": "draft"}),
856+
Document(content="Doc 1", meta={"category": "TypeA", "status": "draft"}),
857+
Document(content="Doc 2", meta={"category": "TypeB", "status": "draft"}),
858+
Document(content="Doc 3", meta={"category": "TypeA", "status": "draft"}),
859859
]
860860
document_store.write_documents(docs)
861861
assert document_store.count_documents() == 3
862862

863-
# Update status for category="A" documents
863+
# Update status for category="TypeA" documents
864864
updated_count = document_store.update_by_filter(
865-
filters={"field": "meta.category", "operator": "==", "value": "A"}, meta={"status": "published"}
865+
filters={"field": "meta.category", "operator": "==", "value": "TypeA"}, meta={"status": "published"}
866866
)
867867
assert updated_count == 2
868868

@@ -872,5 +872,5 @@ def test_update_by_filter(self, document_store):
872872
)
873873
assert len(published_docs) == 2
874874
for doc in published_docs:
875-
assert doc.meta["category"] == "A"
875+
assert doc.meta["category"] == "TypeA"
876876
assert doc.meta["status"] == "published"

integrations/weaviate/tests/test_document_store_async.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -169,37 +169,37 @@ async def test_hybrid_retrieval_async_with_alpha(self, document_store):
169169
@pytest.mark.asyncio
170170
async def test_delete_by_filter_async(self, document_store):
171171
docs = [
172-
Document(content="Doc 1", meta={"category": "A"}),
173-
Document(content="Doc 2", meta={"category": "B"}),
174-
Document(content="Doc 3", meta={"category": "A"}),
172+
Document(content="Doc 1", meta={"category": "TypeA"}),
173+
Document(content="Doc 2", meta={"category": "TypeB"}),
174+
Document(content="Doc 3", meta={"category": "TypeA"}),
175175
]
176176
document_store.write_documents(docs)
177177

178-
# delete documents with category="A"
178+
# delete documents with category="TypeA"
179179
deleted_count = await document_store.delete_by_filter_async(
180-
filters={"field": "meta.category", "operator": "==", "value": "A"}
180+
filters={"field": "meta.category", "operator": "==", "value": "TypeA"}
181181
)
182182
assert deleted_count == 2
183183
assert document_store.count_documents() == 1
184184

185-
# verify only category B remains
185+
# verify only category TypeB remains
186186
remaining_docs = document_store.filter_documents()
187187
assert len(remaining_docs) == 1
188-
assert remaining_docs[0].meta["category"] == "B"
188+
assert remaining_docs[0].meta["category"] == "TypeB"
189189

190190
@pytest.mark.asyncio
191191
async def test_update_by_filter_async(self, document_store):
192192
docs = [
193-
Document(content="Doc 1", meta={"category": "A", "status": "draft"}),
194-
Document(content="Doc 2", meta={"category": "B", "status": "draft"}),
195-
Document(content="Doc 3", meta={"category": "A", "status": "draft"}),
193+
Document(content="Doc 1", meta={"category": "TypeA", "status": "draft"}),
194+
Document(content="Doc 2", meta={"category": "TypeB", "status": "draft"}),
195+
Document(content="Doc 3", meta={"category": "TypeA", "status": "draft"}),
196196
]
197197
document_store.write_documents(docs)
198198
assert document_store.count_documents() == 3
199199

200-
# update status for category="A" documents
200+
# update status for category="TypeA" documents
201201
updated_count = await document_store.update_by_filter_async(
202-
filters={"field": "meta.category", "operator": "==", "value": "A"}, meta={"status": "published"}
202+
filters={"field": "meta.category", "operator": "==", "value": "TypeA"}, meta={"status": "published"}
203203
)
204204
assert updated_count == 2
205205

@@ -209,5 +209,5 @@ async def test_update_by_filter_async(self, document_store):
209209
)
210210
assert len(published_docs) == 2
211211
for doc in published_docs:
212-
assert doc.meta["category"] == "A"
212+
assert doc.meta["category"] == "TypeA"
213213
assert doc.meta["status"] == "published"

0 commit comments

Comments
 (0)