Commit 732d9ce3 authored by Tim Peters's avatar Tim Peters

Whitespace normalization.

parent e1ee2e18
...@@ -35,7 +35,7 @@ class HMAC: ...@@ -35,7 +35,7 @@ class HMAC:
self.outer = digestmod.new() self.outer = digestmod.new()
self.inner = digestmod.new() self.inner = digestmod.new()
self.digest_size = digestmod.digest_size self.digest_size = digestmod.digest_size
blocksize = 64 blocksize = 64
ipad = "\x36" * blocksize ipad = "\x36" * blocksize
opad = "\x5C" * blocksize opad = "\x5C" * blocksize
...@@ -97,4 +97,3 @@ def new(key, msg = None, digestmod = None): ...@@ -97,4 +97,3 @@ def new(key, msg = None, digestmod = None):
method. method.
""" """
return HMAC(key, msg, digestmod) return HMAC(key, msg, digestmod)
...@@ -283,7 +283,7 @@ def _safe_repr(object, context, maxlevels, level): ...@@ -283,7 +283,7 @@ def _safe_repr(object, context, maxlevels, level):
recursive = 1 recursive = 1
del context[objid] del context[objid]
return format % _commajoin(components), readable, recursive return format % _commajoin(components), readable, recursive
rep = `object` rep = `object`
return rep, (rep and not rep.startswith('<')), 0 return rep, (rep and not rep.startswith('<')), 0
......
...@@ -24,7 +24,7 @@ class DumbDBMTestCase(unittest.TestCase): ...@@ -24,7 +24,7 @@ class DumbDBMTestCase(unittest.TestCase):
unittest.TestCase.__init__(self, *args) unittest.TestCase.__init__(self, *args)
self._dkeys = self._dict.keys() self._dkeys = self._dict.keys()
self._dkeys.sort() self._dkeys.sort()
def test_dumbdbm_creation(self): def test_dumbdbm_creation(self):
for ext in [".dir", ".dat", ".bak"]: for ext in [".dir", ".dat", ".bak"]:
try: os.unlink(self._fname+ext) try: os.unlink(self._fname+ext)
...@@ -57,7 +57,7 @@ class DumbDBMTestCase(unittest.TestCase): ...@@ -57,7 +57,7 @@ class DumbDBMTestCase(unittest.TestCase):
keys = self.keys_helper(f) keys = self.keys_helper(f)
for key in self._dict: for key in self._dict:
self.assertEqual(self._dict[key], f[key]) self.assertEqual(self._dict[key], f[key])
def keys_helper(self, f): def keys_helper(self, f):
keys = f.keys() keys = f.keys()
keys.sort() keys.sort()
......
...@@ -45,7 +45,7 @@ class ConstructorTestCase(unittest.TestCase): ...@@ -45,7 +45,7 @@ class ConstructorTestCase(unittest.TestCase):
h = hmac.HMAC("key", "", sha) h = hmac.HMAC("key", "", sha)
except: except:
self.fail("Constructor call with sha module raised exception.") self.fail("Constructor call with sha module raised exception.")
class SanityTestCase(unittest.TestCase): class SanityTestCase(unittest.TestCase):
def test_default_is_md5(self): def test_default_is_md5(self):
"""Testing if HMAC defaults to MD5 algorithm.""" """Testing if HMAC defaults to MD5 algorithm."""
...@@ -106,4 +106,3 @@ def test_main(): ...@@ -106,4 +106,3 @@ def test_main():
if __name__ == "__main__": if __name__ == "__main__":
test_main() test_main()
# #
# Test suite to check compliance with PEP 247, the standard API for # Test suite to check compliance with PEP 247, the standard API for
# hashing algorithms. # hashing algorithms.
# #
import md5, sha, hmac import md5, sha, hmac
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment