summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2010-01-05 00:04:19 (GMT)
committerBenjamin Peterson <benjamin@python.org>2010-01-05 00:04:19 (GMT)
commit2b6e4bc3ad0abde98a46600d0b05632abc9446ed (patch)
treecb201666a210581b75463e5cc6b55bf4ccab566c
parentaf45b11527de9ade4e6e806a8560551652c2eb20 (diff)
downloadcpython-2b6e4bc3ad0abde98a46600d0b05632abc9446ed.zip
cpython-2b6e4bc3ad0abde98a46600d0b05632abc9446ed.tar.gz
cpython-2b6e4bc3ad0abde98a46600d0b05632abc9446ed.tar.bz2
add a test about hashing array.array
-rw-r--r--Lib/test/test_hashlib.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_hashlib.py b/Lib/test/test_hashlib.py
index 751d1f6..b5fee51 100644
--- a/Lib/test/test_hashlib.py
+++ b/Lib/test/test_hashlib.py
@@ -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')