From b480c840416a79540a58ea76dbd9e50e4af23e0d Mon Sep 17 00:00:00 2001 From: Inex Code Date: Thu, 29 Jun 2023 13:44:29 +0300 Subject: [PATCH] style: fix styling --- selfprivacy_api/backup/__init__.py | 20 +++++++------------- tests/test_graphql/test_backup.py | 2 +- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/selfprivacy_api/backup/__init__.py b/selfprivacy_api/backup/__init__.py index f4d7ab2..7a60ecb 100644 --- a/selfprivacy_api/backup/__init__.py +++ b/selfprivacy_api/backup/__init__.py @@ -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) - - - diff --git a/tests/test_graphql/test_backup.py b/tests/test_graphql/test_backup.py index cc5a1eb..a212ade 100644 --- a/tests/test_graphql/test_backup.py +++ b/tests/test_graphql/test_backup.py @@ -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):