mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-22 12:11:26 +00:00
style: fix styling
This commit is contained in:
parent
cd2e9d3ba3
commit
b480c84041
|
@ -37,7 +37,7 @@ DEFAULT_JSON_PROVIDER = {
|
|||
class Backups:
|
||||
"""A stateless controller class for backups"""
|
||||
|
||||
### Providers
|
||||
### Providers
|
||||
|
||||
@staticmethod
|
||||
def provider():
|
||||
|
@ -70,7 +70,6 @@ class Backups:
|
|||
# if there is no userdata file, we do not need to reset it
|
||||
pass
|
||||
|
||||
|
||||
@staticmethod
|
||||
def _lookup_provider() -> AbstractBackupProvider:
|
||||
redis_provider = Backups._load_provider_redis()
|
||||
|
@ -160,7 +159,7 @@ class Backups:
|
|||
|
||||
user_data["backup"] = DEFAULT_JSON_PROVIDER
|
||||
|
||||
### Init
|
||||
### Init
|
||||
|
||||
@staticmethod
|
||||
def init_repo():
|
||||
|
@ -179,7 +178,7 @@ class Backups:
|
|||
|
||||
return False
|
||||
|
||||
### Backup
|
||||
### Backup
|
||||
|
||||
@staticmethod
|
||||
def back_up(service: Service):
|
||||
|
@ -207,8 +206,7 @@ class Backups:
|
|||
Jobs.update(job, status=JobStatus.FINISHED)
|
||||
return snapshot
|
||||
|
||||
### Restoring
|
||||
|
||||
### Restoring
|
||||
|
||||
@staticmethod
|
||||
def restore_snapshot(snapshot: Snapshot):
|
||||
|
@ -271,7 +269,7 @@ class Backups:
|
|||
folders,
|
||||
)
|
||||
|
||||
### Snapshots
|
||||
### Snapshots
|
||||
|
||||
@staticmethod
|
||||
def get_snapshots(service: Service) -> List[Snapshot]:
|
||||
|
@ -328,9 +326,8 @@ class Backups:
|
|||
# expiring cache entry
|
||||
Storage.cache_snapshot(snapshot)
|
||||
|
||||
### Autobackup
|
||||
|
||||
### Autobackup
|
||||
|
||||
@staticmethod
|
||||
def is_autobackup_enabled(service: Service) -> bool:
|
||||
return Storage.is_autobackup_set(service.get_id())
|
||||
|
@ -424,7 +421,7 @@ class Backups:
|
|||
)
|
||||
]
|
||||
|
||||
### Helpers
|
||||
### Helpers
|
||||
|
||||
@staticmethod
|
||||
def space_usable_for_service(service: Service) -> int:
|
||||
|
@ -446,6 +443,3 @@ class Backups:
|
|||
repo_id="",
|
||||
)
|
||||
Storage.store_provider(provider)
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -315,7 +315,7 @@ def test_backup_larger_file(backups, dummy_service):
|
|||
assert_job_has_run(job_type_id)
|
||||
updates = job_progress_updates(job_type_id)
|
||||
assert len(updates) > 3
|
||||
assert updates[int((len(updates)-1)/2.0)] > 10
|
||||
assert updates[int((len(updates) - 1) / 2.0)] > 10
|
||||
|
||||
|
||||
def test_restore_snapshot_task(backups, dummy_service):
|
||||
|
|
Loading…
Reference in a new issue