Skip to content

Commit

Permalink
TST #183 test the hash
Browse files Browse the repository at this point in the history
  • Loading branch information
prjemian committed Jan 1, 2022
1 parent f3abb23 commit 25adbeb
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion punx/tests/test_finding.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def test_exception(h5_address, test_name, status, comment, xceptn):
["A", "this", finding.OK, "looks good"],
]
)
def test_str(addr, test_name, status, comment):
def test_Finding_str(addr, test_name, status, comment):
expect = (
"finding.Finding("
f"{addr}"
Expand All @@ -53,3 +53,24 @@ def test_standard():
key_list = list(sorted(map(str, finding.TF_RESULT.keys())))
k2 = list(sorted(map(str, (False, True))))
assert key_list == k2


@pytest.mark.parametrize(
"addr, test_name, status, comment",
[
[None, None, finding.ERROR, None],
["h5_address", "test_name", finding.NOTE, "comment"],
["A", "this", finding.OK, "looks good"],
]
)
def test_Finding_make_md5(addr, test_name, status, comment):
f = finding.Finding(addr, test_name, status, comment)
if addr is None:
with pytest.raises(TypeError):
f.make_md5()
else:
md5 = f.make_md5()
assert isinstance(md5, str)

# can be duplicated from same inputs (is NOT random)
assert md5 == f.make_md5()

0 comments on commit 25adbeb

Please sign in to comment.