mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-29 07:21:27 +00:00
refactor(backups): rename service_snapshot_size to snapshot_restored_size
This commit is contained in:
parent
7147f97077
commit
ae16a527a2
|
@ -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,
|
||||
)
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue