|
15 | 15 | # specific language governing permissions and limitations |
16 | 16 | # under the License. |
17 | 17 | # pylint:disable=redefined-outer-name,eval-used |
| 18 | +import uuid |
18 | 19 | from typing import cast |
19 | 20 | from unittest.mock import patch |
20 | 21 |
|
@@ -77,7 +78,7 @@ def test_validation_history(table_v2_with_extensive_snapshots_and_manifests: tup |
77 | 78 | ] |
78 | 79 | ) |
79 | 80 |
|
80 | | - def mock_read_manifest_side_effect(self: Snapshot, io: FileIO) -> list[ManifestFile]: |
| 81 | + def mock_read_manifest_side_effect(self: Snapshot, io: FileIO, table_uuid: uuid.UUID | None = None) -> list[ManifestFile]: |
81 | 82 | """Mock the manifests method to use the snapshot_id for lookup.""" |
82 | 83 | snapshot_id = self.snapshot_id |
83 | 84 | if snapshot_id in mock_manifests: |
@@ -133,7 +134,7 @@ def test_validation_history_fails_on_from_snapshot_not_matching_last_snapshot( |
133 | 134 | oldest_snapshot = table.snapshots()[0] |
134 | 135 | newest_snapshot = cast(Snapshot, table.current_snapshot()) |
135 | 136 |
|
136 | | - def mock_read_manifest_side_effect(self: Snapshot, io: FileIO) -> list[ManifestFile]: |
| 137 | + def mock_read_manifest_side_effect(self: Snapshot, io: FileIO, table_uuid: uuid.UUID | None = None) -> list[ManifestFile]: |
137 | 138 | """Mock the manifests method to use the snapshot_id for lookup.""" |
138 | 139 | snapshot_id = self.snapshot_id |
139 | 140 | if snapshot_id in mock_manifests: |
@@ -162,7 +163,7 @@ def test_deleted_data_files( |
162 | 163 | oldest_snapshot = table.snapshots()[0] |
163 | 164 | newest_snapshot = cast(Snapshot, table.current_snapshot()) |
164 | 165 |
|
165 | | - def mock_read_manifest_side_effect(self: Snapshot, io: FileIO) -> list[ManifestFile]: |
| 166 | + def mock_read_manifest_side_effect(self: Snapshot, io: FileIO, table_uuid: uuid.UUID | None = None) -> list[ManifestFile]: |
166 | 167 | """Mock the manifests method to use the snapshot_id for lookup.""" |
167 | 168 | snapshot_id = self.snapshot_id |
168 | 169 | if snapshot_id in mock_manifests: |
@@ -257,7 +258,7 @@ def test_validate_added_data_files_conflicting_count( |
257 | 258 | boundary_snapshot = table.snapshots()[-(snapshot_history + 1)] |
258 | 259 | newest_snapshot = cast(Snapshot, table.current_snapshot()) |
259 | 260 |
|
260 | | - def mock_read_manifest_side_effect(self: Snapshot, io: FileIO) -> list[ManifestFile]: |
| 261 | + def mock_read_manifest_side_effect(self: Snapshot, io: FileIO, table_uuid: uuid.UUID | None = None) -> list[ManifestFile]: |
261 | 262 | """Mock the manifests method to use the snapshot_id for lookup.""" |
262 | 263 | snapshot_id = self.snapshot_id |
263 | 264 | if snapshot_id in mock_manifests: |
@@ -311,7 +312,7 @@ def test_validate_added_data_files_non_conflicting_count( |
311 | 312 | oldest_snapshot = table.snapshots()[-snapshot_history] |
312 | 313 | newest_snapshot = cast(Snapshot, table.current_snapshot()) |
313 | 314 |
|
314 | | - def mock_read_manifest_side_effect(self: Snapshot, io: FileIO) -> list[ManifestFile]: |
| 315 | + def mock_read_manifest_side_effect(self: Snapshot, io: FileIO, table_uuid: uuid.UUID | None = None) -> list[ManifestFile]: |
315 | 316 | """Mock the manifests method to use the snapshot_id for lookup.""" |
316 | 317 | snapshot_id = self.snapshot_id |
317 | 318 | if snapshot_id in mock_manifests: |
@@ -384,7 +385,7 @@ def test_added_delete_files_non_conflicting_count( |
384 | 385 | oldest_snapshot = table.snapshots()[-snapshot_history] |
385 | 386 | newest_snapshot = cast(Snapshot, table.current_snapshot()) |
386 | 387 |
|
387 | | - def mock_read_manifest_side_effect(self: Snapshot, io: FileIO) -> list[ManifestFile]: |
| 388 | + def mock_read_manifest_side_effect(self: Snapshot, io: FileIO, table_uuid: uuid.UUID | None = None) -> list[ManifestFile]: |
388 | 389 | """Mock the manifests method to use the snapshot_id for lookup.""" |
389 | 390 | snapshot_id = self.snapshot_id |
390 | 391 | if snapshot_id in mock_manifests: |
@@ -442,7 +443,7 @@ def test_added_delete_files_conflicting_count( |
442 | 443 |
|
443 | 444 | mock_delete_file.spec_id = 0 |
444 | 445 |
|
445 | | - def mock_read_manifest_side_effect(self: Snapshot, io: FileIO) -> list[ManifestFile]: |
| 446 | + def mock_read_manifest_side_effect(self: Snapshot, io: FileIO, table_uuid: uuid.UUID | None = None) -> list[ManifestFile]: |
446 | 447 | """Mock the manifests method to use the snapshot_id for lookup.""" |
447 | 448 | snapshot_id = self.snapshot_id |
448 | 449 | if snapshot_id in mock_manifests: |
|
0 commit comments