refactor(backups): rename service_snapshot_size to snapshot_restored_size

This commit is contained in:
Houkime 2023-06-26 19:41:18 +00:00
parent 7147f97077
commit ae16a527a2
2 changed files with 3 additions and 3 deletions

View file

@ -254,7 +254,7 @@ class Backups:
f"snapshot has a nonexistent service: {snapshot.service_name}"
)
needed_space = Backups.service_snapshot_size(snapshot.id)
needed_space = Backups.snapshot_restored_size(snapshot.id)
available_space = Backups.space_usable_for_service(service)
if needed_space > available_space:
raise ValueError(
@ -315,7 +315,7 @@ class Backups:
Storage.cache_snapshot(snapshot)
@staticmethod
def service_snapshot_size(snapshot_id: str) -> int:
def snapshot_restored_size(snapshot_id: str) -> int:
return Backups.provider().backupper.restored_size(
snapshot_id,
)

View file

@ -232,7 +232,7 @@ def test_restore(backups, dummy_service):
def test_sizing(backups, dummy_service):
Backups.back_up(dummy_service)
snap = Backups.get_snapshots(dummy_service)[0]
size = Backups.service_snapshot_size(snap.id)
size = Backups.snapshot_restored_size(snap.id)
assert size is not None
assert size > 0