[Python-checkins] r77313 - python/trunk/Lib/test/test_hashlib.py
benjamin.peterson
python-checkins at python.org
Tue Jan 5 01:04:19 CET 2010
Author: benjamin.peterson
Date: Tue Jan 5 01:04:19 2010
New Revision: 77313
Log:
add a test about hashing array.array
Modified:
python/trunk/Lib/test/test_hashlib.py
Modified: python/trunk/Lib/test/test_hashlib.py
==============================================================================
--- python/trunk/Lib/test/test_hashlib.py (original)
+++ python/trunk/Lib/test/test_hashlib.py Tue Jan 5 01:04:19 2010
@@ -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 @@
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')
More information about the Python-checkins
mailing list