Skip to content

Commit 43ce95f

Browse files
webjunkie01dill0wn
authored andcommitted
[#8595] added tests and fixed hide_email function
1 parent 7f5e7c4 commit 43ce95f

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

Allura/allura/lib/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -936,3 +936,4 @@ def hide_name(email_address):
936936
return ', '.join(emails)
937937
email = hide_name(email)
938938
email = hide(email)
939+
return email

Allura/allura/tests/test_utils.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,3 +429,9 @@ def test_join_paths_no_traversal(base, paths, expected: str | type[Exception]):
429429
else:
430430
with pytest.raises(expected):
431431
utils.join_paths_no_traversal(base, *paths)
432+
433+
434+
def test_hide_email():
435+
assert utils.hide_email('foo@bar.com') == '<fo...@ba...>'
436+
assert utils.hide_email('email@example.com') == '<em...@ex...>'
437+
assert utils.hide_email('email@example') == '<em...@ex...>'

0 commit comments

Comments
 (0)