Back to index

python3.2  3.2.2
Public Member Functions
test.test_hmac.SanityTestCase Class Reference

List of all members.

Public Member Functions

def test_default_is_md5
def test_exercise_all_methods

Detailed Description

Definition at line 251 of file

Member Function Documentation

Definition at line 253 of file

00254     def test_default_is_md5(self):
00255         # Testing if HMAC defaults to MD5 algorithm.
00256         # NOTE: this whitebox test depends on the hmac class internals
00257         h = hmac.HMAC(b"key")
00258         self.assertEqual(h.digest_cons, hashlib.md5)

Here is the call graph for this function:

Definition at line 259 of file

00260     def test_exercise_all_methods(self):
00261         # Exercising all methods once.
00262         # This must not raise any exceptions
00263         try:
00264             h = hmac.HMAC(b"my secret key")
00265             h.update(b"compute the hash of this text!")
00266             dig = h.digest()
00267             dig = h.hexdigest()
00268             h2 = h.copy()
00269         except:
00270   "Exception raised during normal usage of HMAC class.")

Here is the call graph for this function:

The documentation for this class was generated from the following file: