|
1 | 1 | import datetime |
2 | 2 | import json |
3 | 3 | import time |
4 | | -from typing import Any, Dict |
| 4 | +from typing import Any, Dict, Literal |
5 | 5 |
|
6 | 6 | import grpc |
7 | 7 | import pytest |
|
17 | 17 | CLIENT_ID, |
18 | 18 | MockRetriesWeaviateService, |
19 | 19 | ) |
| 20 | +from weaviate.backup.backup import BackupStorage |
20 | 21 | from weaviate.collections.classes.config import ( |
21 | 22 | CollectionConfig, |
22 | 23 | VectorIndexConfigFlat, |
|
30 | 31 | Vectorizers, |
31 | 32 | VectorIndexType, |
32 | 33 | ShardingConfig, |
| 34 | + ReplicationDeletionStrategy, |
33 | 35 | ) |
34 | 36 | from weaviate.connect.base import ConnectionParams, ProtocolParams |
35 | 37 | from weaviate.connect.integrations import _IntegrationConfig |
@@ -171,7 +173,7 @@ def test_missing_multi_tenancy_config( |
171 | 173 | vector_cache_max_objects=10, |
172 | 174 | multi_vector=None, |
173 | 175 | ) |
174 | | - vic.distance = vic.distance_metric |
| 176 | + vic.distance = vic.distance_metric # type: ignore |
175 | 177 | response_json = CollectionConfig( |
176 | 178 | name="Test", |
177 | 179 | description="", |
@@ -202,7 +204,11 @@ def test_missing_multi_tenancy_config( |
202 | 204 | ), |
203 | 205 | properties=[], |
204 | 206 | references=[], |
205 | | - replication_config=ReplicationConfig(factor=0, async_enabled=False, deletion_strategy=None), |
| 207 | + replication_config=ReplicationConfig( |
| 208 | + factor=0, |
| 209 | + async_enabled=False, |
| 210 | + deletion_strategy=ReplicationDeletionStrategy.NO_AUTOMATED_RESOLUTION, |
| 211 | + ), |
206 | 212 | vector_index_config=vic, |
207 | 213 | vector_index_type=VectorIndexType.FLAT, |
208 | 214 | vectorizer=Vectorizers.NONE, |
@@ -361,7 +367,7 @@ def test_year_zero(year_zero_collection: weaviate.collections.Collection) -> Non |
361 | 367 |
|
362 | 368 | @pytest.mark.parametrize("output", ["minimal", "verbose"]) |
363 | 369 | def test_node_with_timeout( |
364 | | - httpserver: HTTPServer, start_grpc_server: grpc.Server, output: str |
| 370 | + httpserver: HTTPServer, start_grpc_server: grpc.Server, output: Literal["minimal", "verbose"] |
365 | 371 | ) -> None: |
366 | 372 | httpserver.expect_request("/v1/.well-known/ready").respond_with_json({}) |
367 | 373 | httpserver.expect_request("/v1/meta").respond_with_json({"version": "1.24"}) |
@@ -423,14 +429,14 @@ def test_backup_cancel_while_create_and_restore( |
423 | 429 | with pytest.raises(BackupCanceledError): |
424 | 430 | client.backup.create( |
425 | 431 | backup_id=backup_id, |
426 | | - backend="filesystem", |
| 432 | + backend=BackupStorage.FILESYSTEM, |
427 | 433 | wait_for_completion=True, |
428 | 434 | ) |
429 | 435 |
|
430 | 436 | with pytest.raises(BackupCanceledError): |
431 | 437 | client.backup.restore( |
432 | 438 | backup_id=backup_id, |
433 | | - backend="filesystem", |
| 439 | + backend=BackupStorage.FILESYSTEM, |
434 | 440 | wait_for_completion=True, |
435 | 441 | ) |
436 | 442 |
|
|
0 commit comments