mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-10 13:03:11 +00:00
feature(backup): reload snapshots when migrating
This commit is contained in:
parent
a4a70c07d3
commit
bb493e6b74
|
@ -75,6 +75,7 @@ class BackupMutations:
|
|||
secret = repository.local_secret
|
||||
if secret is not None:
|
||||
LocalBackupSecret.set(secret)
|
||||
Backups.force_snapshot_cache_reload()
|
||||
else:
|
||||
Backups.init_repo()
|
||||
return GenericBackupConfigReturn(
|
||||
|
|
|
@ -446,19 +446,19 @@ def test_migrate(authorized_client, dummy_service, tmpdir, backups):
|
|||
# Reinit
|
||||
response = api_init(
|
||||
authorized_client,
|
||||
configuration["provider"],
|
||||
"",
|
||||
"",
|
||||
configuration["locationName"],
|
||||
configuration["locationId"],
|
||||
configuration["encryptionKey"],
|
||||
kind=configuration["provider"],
|
||||
login="", # user provides login and password, configuration endpoint does not
|
||||
password="", # empty for file based repository
|
||||
location_name=configuration["locationName"],
|
||||
location_id=configuration["locationId"],
|
||||
local_secret=configuration["encryptionKey"],
|
||||
)
|
||||
data = get_data(response)["backup"]["initializeRepository"]
|
||||
assert_ok(data)
|
||||
assert data["configuration"] == configuration
|
||||
|
||||
new_configuration = api_settings(authorized_client)
|
||||
assert new_configuration == configuration
|
||||
api_reload_snapshots(authorized_client)
|
||||
|
||||
snaps = api_snapshots(authorized_client)
|
||||
assert len(snaps) == 1
|
||||
|
|
Loading…
Reference in a new issue