Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
963c80fd
Commit
963c80fd
authored
Mar 03, 2008
by
Brett Cannon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a note in the main test class' docstring that the order of execution of the
tests is important.
parent
bfbf5b37
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
Lib/test/test_pep247.py
Lib/test/test_pep247.py
+9
-2
No files found.
Lib/test/test_pep247.py
View file @
963c80fd
...
@@ -10,6 +10,8 @@ warnings.filterwarnings("ignore", "the sha module is deprecated.*",
...
@@ -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):
...
@@ -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
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment