mirror of
https://github.com/python/cpython.git
synced 2025-11-11 22:55:08 +00:00
Add a note in the main test class' docstring that the order of execution of the
tests is important.
This commit is contained in:
parent
bfbf5b3715
commit
963c80fd45
1 changed files with 9 additions and 2 deletions
|
|
@ -10,6 +10,8 @@ warnings.filterwarnings("ignore", "the sha module is deprecated.*",
|
||||||
DeprecationWarning)
|
DeprecationWarning)
|
||||||
|
|
||||||
import md5, sha, hmac
|
import md5, sha, hmac
|
||||||
|
from test.test_support import verbose
|
||||||
|
|
||||||
|
|
||||||
def check_hash_module(module, key=None):
|
def check_hash_module(module, key=None):
|
||||||
assert hasattr(module, 'digest_size'), "Must have digest_size"
|
assert hasattr(module, 'digest_size'), "Must have digest_size"
|
||||||
|
|
@ -47,10 +49,15 @@ def check_hash_module(module, key=None):
|
||||||
hd2 += "%02x" % ord(byte)
|
hd2 += "%02x" % ord(byte)
|
||||||
assert hd2 == hexdigest, "hexdigest doesn't appear correct"
|
assert hd2 == hexdigest, "hexdigest doesn't appear correct"
|
||||||
|
|
||||||
print 'Module', module.__name__, 'seems to comply with PEP 247'
|
if verbose:
|
||||||
|
print 'Module', module.__name__, 'seems to comply with PEP 247'
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
def test_main():
|
||||||
check_hash_module(md5)
|
check_hash_module(md5)
|
||||||
check_hash_module(sha)
|
check_hash_module(sha)
|
||||||
check_hash_module(hmac, key='abc')
|
check_hash_module(hmac, key='abc')
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
test_main()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue