Skip to content

Commit 0bb3c32

Browse files
committed
Merge branch 'main' of https://github.com/weaviate/weaviate-python-client into fix/urls-in-generative-config-runtime
2 parents 582fd85 + 94824a7 commit 0bb3c32

2 files changed

Lines changed: 14 additions & 7 deletions

File tree

integration/test_backup_v4.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,13 @@
7272
"datePublished": datetime.datetime.now(datetime.timezone.utc).isoformat(),
7373
},
7474
]
75+
CLASSES = ["Paragraph", "Article"]
7576

7677

7778
@pytest.fixture(scope="module")
7879
def client() -> Generator[weaviate.WeaviateClient, None, None]:
7980
client = weaviate.connect_to_local()
80-
client.collections.delete("Paragraph")
81-
client.collections.delete("Article")
81+
client.collections.delete(CLASSES)
8282

8383
col_para = client.collections.create(
8484
name="Paragraph",
@@ -123,7 +123,9 @@ def test_create_and_restore_backup_with_waiting(client: weaviate.WeaviateClient)
123123

124124
# create backup
125125
classes = ["Article", "Paragraph"]
126-
resp = client.backup.create(backup_id=backup_id, backend=BACKEND, wait_for_completion=True)
126+
resp = client.backup.create(
127+
backup_id=backup_id, backend=BACKEND, wait_for_completion=True, include_collections=CLASSES
128+
)
127129
assert resp.status == BackupStatus.SUCCESS
128130
for cls in classes:
129131
assert cls in resp.collections
@@ -141,7 +143,9 @@ def test_create_and_restore_backup_with_waiting(client: weaviate.WeaviateClient)
141143
client.collections.delete("Paragraph")
142144

143145
# restore backup
144-
restore = client.backup.restore(backup_id=backup_id, backend=BACKEND, wait_for_completion=True)
146+
restore = client.backup.restore(
147+
backup_id=backup_id, backend=BACKEND, wait_for_completion=True, include_collections=CLASSES
148+
)
145149
assert restore.status == BackupStatus.SUCCESS
146150
for cls in classes:
147151
assert cls in resp.collections
@@ -349,7 +353,7 @@ def test_fail_creating_backup_for_both_include_and_exclude_classes(
349353

350354

351355
@pytest.mark.parametrize("dynamic_backup_location", [False, True])
352-
def test_backup_and_restore_with_collection(
356+
def test_backup_and_restore_with_dynamic_location(
353357
client: weaviate.WeaviateClient, dynamic_backup_location: bool, tmp_path: pathlib.Path
354358
) -> None:
355359
backup_id = _create_backup_id()
@@ -513,7 +517,10 @@ def test_cancel_backup(
513517
backup_location = wvc.backup.BackupLocation.FileSystem(path=str(tmp_path))
514518

515519
resp = client.backup.create(
516-
backup_id=backup_id, backend=BACKEND, backup_location=backup_location
520+
backup_id=backup_id,
521+
backend=BACKEND,
522+
backup_location=backup_location,
523+
include_collections=CLASSES,
517524
)
518525
assert resp.status == BackupStatus.STARTED
519526

integration/test_collection_batch_delete.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ def test_delete_many_with_consistency_level(
645645
Property(name="text", data_type=DataType.TEXT),
646646
Property(name="int", data_type=DataType.INT),
647647
],
648-
).with_consistency_level(ConsistencyLevel.ALL)
648+
).with_consistency_level(ConsistencyLevel.ONE)
649649
collection.data.insert_many(
650650
[
651651
DataObject(properties={"int": 10}, uuid=UUID1),

0 commit comments

Comments
 (0)