diff options
author | Guido van Rossum <guido@python.org> | 2007-07-11 12:20:59 +0000 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-07-11 12:20:59 +0000 |
commit | e61fd5b5ed9d677da2f3349078d7f66f707199de (patch) | |
tree | e28a7630ed3c285eabc7631f4276a2b06e74682b /Lib/test/test_hmac.py | |
parent | c9b9de17976a4832f505309b1096f9a7582c7be9 (diff) | |
download | cpython-git-e61fd5b5ed9d677da2f3349078d7f66f707199de.tar.gz |
Patch by Christian Heimes to change self.assert_(x == y) into
self.assertEqual(x, y). (Christian used self.failUnlessEqual(),
but the double negative makes it hard to grok, so I changed it.)
Diffstat (limited to 'Lib/test/test_hmac.py')
-rw-r--r-- | Lib/test/test_hmac.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/test_hmac.py b/Lib/test/test_hmac.py index b453f049aa..d44197e65a 100644 --- a/Lib/test/test_hmac.py +++ b/Lib/test/test_hmac.py @@ -108,7 +108,7 @@ class SanityTestCase(unittest.TestCase): # NOTE: this whitebox test depends on the hmac class internals import hashlib h = hmac.HMAC("key") - self.failUnless(h.digest_cons == hashlib.md5) + self.assertEqual(h.digest_cons, hashlib.md5) def test_exercise_all_methods(self): # Exercising all methods once. @@ -130,9 +130,9 @@ class CopyTestCase(unittest.TestCase): h2 = h1.copy() self.failUnless(h1.digest_cons == h2.digest_cons, "digest constructors don't match.") - self.failUnless(type(h1.inner) == type(h2.inner), + self.assertEqual(type(h1.inner), type(h2.inner), "Types of inner don't match.") - self.failUnless(type(h1.outer) == type(h2.outer), + self.assertEqual(type(h1.outer), type(h2.outer), "Types of outer don't match.") def test_realcopy(self): @@ -151,9 +151,9 @@ class CopyTestCase(unittest.TestCase): h1 = hmac.HMAC("key") h1.update("some random text") h2 = h1.copy() - self.failUnless(h1.digest() == h2.digest(), + self.assertEqual(h1.digest(), h2.digest(), "Digest of copy doesn't match original digest.") - self.failUnless(h1.hexdigest() == h2.hexdigest(), + self.assertEqual(h1.hexdigest(), h2.hexdigest(), "Hexdigest of copy doesn't match original hexdigest.") def test_main(): |