Skip to content

Commit 2323f9f

Browse files
committed
Make use of backup location fixture
1 parent dfc639b commit 2323f9f

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
@@ -1734,14 +1734,11 @@ async def test_backup_remove_error(
17341734
healthy_expected: bool,
17351735
):
17361736
"""Test removing a backup error."""
1737-
backup_file = get_fixture_path("backup_example.tar")
1738-
if location_name is None:
1739-
copy(backup_file, coresys.config.path_backup)
1740-
location = None
1741-
else:
1742-
(mount_dir := coresys.config.path_mounts / location_name).mkdir()
1743-
copy(backup_file, mount_dir)
1744-
location = coresys.mounts.get(location_name)
1737+
location: LOCATION_TYPE = backup_locations[0]
1738+
backup_base_path = coresys.backups._get_base_path(location)
1739+
backup_base_path.mkdir(exist_ok=True)
1740+
copy(get_fixture_path("backup_example.tar"), backup_base_path)
1741+
17451742
await coresys.backups.reload(location=location, filename="backup_example.tar")
17461743
assert (backup := coresys.backups.get("7fed74c8"))
17471744

0 commit comments

Comments
 (0)