def test_non_matching_digests_should_return_false(self): secret = 'secrettoken' message = 'message blah blah horse battery staple' Secret.set(secret) digest_received = Secret._get_hex_digest('not the original message', secret) self.assertFalse(Secret.digest_is_valid(digest_received, message))
def test_matching_digests_should_return_true(self): secret = 'secrettoken' message = 'message blah blah horse battery staple' Secret.set(secret) digest_received = Secret._get_hex_digest(message, secret) self.assertTrue(Secret.digest_is_valid(digest_received, message))