commit: 677649351c171685d332b9d9e500da31baf33a74
Author: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 23 19:30:46 2024 +0000
Commit: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Tue Jan 23 19:30:46 2024 +0000
URL:
https://gitweb.gentoo.org/proj/pkgcore/pkgcore.git/commit/?id=67764935
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 <AT> gentoo.org>
tests/fs/test_ops.py | 9 +++++++++
1 file changed, 9 insertions(+)
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