mirror of
1
0
Fork 0

Add: test_link_force_overwrite_source

This commit is contained in:
c-c-k 2023-07-28 20:00:57 +03:00
parent 28780a3d0e
commit 0e4b0aec56
1 changed files with 26 additions and 0 deletions

View File

@ -175,6 +175,32 @@ def test_link_force_overwrite_symlink(home, dotfiles, run_dotbot):
assert os.path.isfile(os.path.join(home, ".dir", "f"))
def test_link_force_overwrite_source(home, dotfiles, run_dotbot):
"""Verify force overwrites a symlinked directory."""
os.symlink(home, os.path.join(home, ".link"))
with open(os.path.join(home, "file"), "w") as file:
file.write("")
os.mkdir(os.path.join(home, "dir"))
dotfiles.write("dir/f")
config = [
{
"link": {
"~/.link": {"path": "dir", "force": True},
"~/file": {"path": "dir", "force": True},
"~/dir": {"path": "dir", "force": True},
}
}
]
dotfiles.write_config(config)
run_dotbot()
assert os.path.isfile(os.path.join(home, ".link", "f"))
assert os.path.isfile(os.path.join(home, "file", "f"))
assert os.path.isfile(os.path.join(home, "dir", "f"))
def test_link_glob_1(home, dotfiles, run_dotbot):
"""Verify globbing works."""