mirror of
1
0
Fork 0

Add: test_backup_mirrors_absolute_path

This commit is contained in:
c-c-k 2023-07-28 07:59:57 +03:00
parent 52a9c347d1
commit 91b4485778
1 changed files with 14 additions and 0 deletions

View File

@ -201,6 +201,20 @@ def test_link_force_overwrite_source(home, dotfiles, run_dotbot):
assert os.path.isfile(os.path.join(home, "dir", "f"))
def test_backup_mirrors_absolute_path(home, dotfiles, run_dotbot):
"""Verify backup path from backup dir is same as original path from root."""
os.symlink(home, os.path.join(home, ".f"))
dotfiles.write("f")
backup_root = os.path.join(dotfiles.directory, "backup")
config = [{"link": {"~/.f": {"path": "f", "force": True, "backup-root": backup_root}}}]
dotfiles.write_config(config)
run_dotbot()
assert os.path.isdir(os.path.join(backup_root, home[1:]))
def test_link_force_backups_source(home, dotfiles, run_dotbot):
"""Verify force backups a symlinked directory."""