We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9e18fb4 commit be40402Copy full SHA for be40402
metomi/rose/tests/test_checksum.py
@@ -37,9 +37,16 @@ def test__get_hexdigest_path(tmp_path):
37
assert _get_hexdigest('md5', handle) == expect
38
39
40
-def test_get_hexdigest_symlinks(tmp_path):
+def test_get_hexdigest_symlink(tmp_path):
41
+ """Function converts symlinks to non-existent files to hexdigest
42
+ of the target path.
43
+
44
+ https://github.com/metomi/rose/issues/2946
45
+ """
46
link = tmp_path / 'link'
47
missing = tmp_path / 'missing'
48
# missing.touch()
49
link.symlink_to(missing)
- assert _get_hexdigest('md5', str(missing)) == md5(b'missing').hexdigest()
50
+ result = _get_hexdigest('md5', str(link))
51
+ control = md5(str(missing).encode()).hexdigest()
52
+ assert result == control
0 commit comments