diff options
author | 2024-01-23 21:30:46 +0200 | |
---|---|---|
committer | 2024-01-23 21:30:46 +0200 | |
commit | 677649351c171685d332b9d9e500da31baf33a74 (patch) | |
tree | 06410e21ee626ab6c535929aa56f6b4fb3e6916e | |
parent | refactor: loosen prototype.tree._get_* requirements, add typing. (diff) | |
download | pkgcore-677649351c171685d332b9d9e500da31baf33a74.tar.gz pkgcore-677649351c171685d332b9d9e500da31baf33a74.tar.bz2 pkgcore-677649351c171685d332b9d9e500da31baf33a74.zip |
tests/fs/test_ops: add test_dir_over_sym
Based on work at commit 33f03d9ae71df55082e5b196e1db24c642e19db9 by
Tim Harder <radhermit>.
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
-rw-r--r-- | tests/fs/test_ops.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/fs/test_ops.py b/tests/fs/test_ops.py index fcc058160..fd0f12ccb 100644 --- a/tests/fs/test_ops.py +++ b/tests/fs/test_ops.py @@ -208,6 +208,15 @@ class TestMergeContents(ContentsMixin): with pytest.raises(ops.CannotOverwrite): ops.merge_contents(cset) + def test_dir_over_sym(self, tmp_path): + # dirs can be merged over symlinks to dirs + (dir_path := tmp_path / "dir").mkdir() + (path := tmp_path / "sym").symlink_to(dir_path) + d = fs.fsDir(str(path), mode=0o755, mtime=0, uid=os.getuid(), gid=os.getgid()) + cset = contents.contentsSet([d]) + assert ops.merge_contents(cset) + assert fs.issym(livefs.gen_obj(str(path))) + class TestUnmergeContents(ContentsMixin): @pytest.fixture |