Added some pytest

Signed-off-by: Dimitris Zlatanidis <d.zlatanidis@gmail.com>
This commit is contained in:
Dimitris Zlatanidis 2020-01-05 23:51:59 +01:00
parent 80be208729
commit a3605544f6

View file

@ -33,3 +33,11 @@ def md5(source):
with open(source, "rb") as file_to_check:
data = file_to_check.read()
return hashlib.md5(data).hexdigest()
def test_md5(source="superuser.py"):
"""Testing hashing with pytest"""
source = source.replace("%2B", "+")
with open(source, "rb") as file_to_check:
data = file_to_check.read()
assert hashlib.md5(data).hexdigest() == "e6cebdf37fbc1b8e9d3c5e3e53b300c1"