Skip to content

Commit be40402

Browse files
committed
Tidy test
1 parent 9e18fb4 commit be40402

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

metomi/rose/tests/test_checksum.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,16 @@ def test__get_hexdigest_path(tmp_path):
3737
assert _get_hexdigest('md5', handle) == expect
3838

3939

40-
def test_get_hexdigest_symlinks(tmp_path):
40+
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+
"""
4146
link = tmp_path / 'link'
4247
missing = tmp_path / 'missing'
4348
# missing.touch()
4449
link.symlink_to(missing)
45-
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

Comments
 (0)