mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-09-20 15:37:50 +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
|
secret = repository.local_secret
|
||||||
if secret is not None:
|
if secret is not None:
|
||||||
LocalBackupSecret.set(secret)
|
LocalBackupSecret.set(secret)
|
||||||
|
Backups.force_snapshot_cache_reload()
|
||||||
else:
|
else:
|
||||||
Backups.init_repo()
|
Backups.init_repo()
|
||||||
return GenericBackupConfigReturn(
|
return GenericBackupConfigReturn(
|
||||||
|
|
|
@ -446,19 +446,19 @@ def test_migrate(authorized_client, dummy_service, tmpdir, backups):
|
||||||
# Reinit
|
# Reinit
|
||||||
response = api_init(
|
response = api_init(
|
||||||
authorized_client,
|
authorized_client,
|
||||||
configuration["provider"],
|
kind=configuration["provider"],
|
||||||
"",
|
login="", # user provides login and password, configuration endpoint does not
|
||||||
"",
|
password="", # empty for file based repository
|
||||||
configuration["locationName"],
|
location_name=configuration["locationName"],
|
||||||
configuration["locationId"],
|
location_id=configuration["locationId"],
|
||||||
configuration["encryptionKey"],
|
local_secret=configuration["encryptionKey"],
|
||||||
)
|
)
|
||||||
data = get_data(response)["backup"]["initializeRepository"]
|
data = get_data(response)["backup"]["initializeRepository"]
|
||||||
assert_ok(data)
|
assert_ok(data)
|
||||||
|
assert data["configuration"] == configuration
|
||||||
|
|
||||||
new_configuration = api_settings(authorized_client)
|
new_configuration = api_settings(authorized_client)
|
||||||
assert new_configuration == configuration
|
assert new_configuration == configuration
|
||||||
api_reload_snapshots(authorized_client)
|
|
||||||
|
|
||||||
snaps = api_snapshots(authorized_client)
|
snaps = api_snapshots(authorized_client)
|
||||||
assert len(snaps) == 1
|
assert len(snaps) == 1
|
||||||
|
|
Loading…
Reference in a new issue