Skip to content

Commit 3d4d311

Browse files
agnersmdegat01
authored andcommitted
Make use of backup location fixture
1 parent f426696 commit 3d4d311

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

tests/backups/test_manager.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1756,14 +1756,11 @@ async def test_backup_remove_error(
17561756
healthy_expected: bool,
17571757
):
17581758
"""Test removing a backup error."""
1759-
backup_file = get_fixture_path("backup_example.tar")
1760-
if location_name is None:
1761-
copy(backup_file, coresys.config.path_backup)
1762-
location = None
1763-
else:
1764-
(mount_dir := coresys.config.path_mounts / location_name).mkdir()
1765-
copy(backup_file, mount_dir)
1766-
location = coresys.mounts.get(location_name)
1759+
location: LOCATION_TYPE = backup_locations[0]
1760+
backup_base_path = coresys.backups._get_base_path(location)
1761+
backup_base_path.mkdir(exist_ok=True)
1762+
copy(get_fixture_path("backup_example.tar"), backup_base_path)
1763+
17671764
await coresys.backups.reload(location=location, filename="backup_example.tar")
17681765
assert (backup := coresys.backups.get("7fed74c8"))
17691766

0 commit comments

Comments
 (0)