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
2b6e4bc3
Commit
2b6e4bc3
authored
Jan 05, 2010
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add a test about hashing array.array
parent
af45b115
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
Lib/test/test_hashlib.py
Lib/test/test_hashlib.py
+9
-0
No files found.
Lib/test/test_hashlib.py
View file @
2b6e4bc3
...
...
@@ -6,8 +6,10 @@
# Licensed to PSF under a Contributor Agreement.
#
import
array
import
hashlib
import
StringIO
import
itertools
import
sys
try
:
import
threading
...
...
@@ -94,6 +96,13 @@ class HashLibTestCase(unittest.TestCase):
super
(
HashLibTestCase
,
self
).
__init__
(
*
args
,
**
kwargs
)
def
test_hash_array
(
self
):
a
=
array
.
array
(
"b"
,
range
(
10
))
constructors
=
self
.
constructors_to_test
.
itervalues
()
for
cons
in
itertools
.
chain
.
from_iterable
(
constructors
):
c
=
cons
(
a
)
c
.
hexdigest
()
def
test_unknown_hash
(
self
):
try
:
hashlib
.
new
(
'spam spam spam spam spam'
)
...
...
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