tests: add new tests for uhashlib differences

.. these tests currently fail, but a subsequent commit will
fix them
This commit is contained in:
Jeff Epler 2018-05-06 12:26:10 -05:00
parent d32349cee8
commit b2084d37d6
2 changed files with 14 additions and 0 deletions

View File

@ -19,3 +19,10 @@ except AttributeError:
sha1 = hashlib.sha1(b'hello')
sha1.update(b'world')
print(sha1.digest())
sha1 = hashlib.sha1(b'hello')
try:
sha1.update(u'world')
except TypeError as e:
print("TypeError")
print(sha1.digest())

View File

@ -23,6 +23,13 @@ print(h.digest())
print(hashlib.sha256(b"\xff" * 64).digest())
sha256 = hashlib.sha256(b'hello')
try:
sha256.update(u'world')
except TypeError as e:
print("TypeError")
print(sha256.digest())
# TODO: running .digest() several times in row is not supported()
#h = hashlib.sha256(b'123')
#print(h.digest())