aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Zamarin <arthurzam@gentoo.org>2024-01-23 21:30:46 +0200
committerArthur Zamarin <arthurzam@gentoo.org>2024-01-23 21:30:46 +0200
commit677649351c171685d332b9d9e500da31baf33a74 (patch)
tree06410e21ee626ab6c535929aa56f6b4fb3e6916e
parentrefactor: loosen prototype.tree._get_* requirements, add typing. (diff)
downloadpkgcore-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.py9
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