Skip to content

Commit

Permalink
Refs #40 - Added unit test.
Browse files Browse the repository at this point in the history
  • Loading branch information
AVPS committed Jan 14, 2016
1 parent b2b1d02 commit 789a57e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/unit/test_digest.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,18 @@ def test_digest(self):

self.assertEqual(result, expected)

def test_digest_w_null(self):
message = b"That's some good ham rig ht there"
predigested = b"That'ssomegoodhamrightthere"

digest = hashlib.sha1()
digest.update(predigested)

expected = digest.hexdigest()
result = DataDigester(message).value

self.assertEqual(result, expected)


class MessageDigestTest(unittest.TestCase):
def setUp(self):
Expand Down

0 comments on commit 789a57e

Please sign in to comment.