File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -1734,12 +1734,20 @@ async def test_backup_remove_error(
17341734 healthy_expected : bool ,
17351735):
17361736 """Test removing a backup error."""
1737- copy (get_fixture_path ("backup_example.tar" ), coresys .config .path_backup )
1738- await coresys .backups .reload (location = None , filename = "backup_example.tar" )
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 )
1745+ await coresys .backups .reload (location = location , filename = "backup_example.tar" )
17391746 assert (backup := coresys .backups .get ("7fed74c8" ))
17401747
1741- backup .all_locations [location_name ] = (tar_mock := MagicMock ())
1742- tar_mock .unlink .side_effect = (err := OSError ())
1748+ assert location_name in backup .all_locations
1749+ backup .all_locations [location_name ]["path" ] = (tar_file_mock := MagicMock ())
1750+ tar_file_mock .unlink .side_effect = (err := OSError ())
17431751
17441752 err .errno = errno .EBUSY
17451753 assert coresys .backups .remove (backup ) is False
You can’t perform that action at this time.
0 commit comments