Commits

Benjamin Peterson committed b05743c

add a test about hashing array.array

Comments (0)

Files changed (1)

Lib/test/test_hashlib.py

 #  Licensed to PSF under a Contributor Agreement.
 #
 
+import array
 import hashlib
 import StringIO
+import itertools
 import sys
 try:
     import threading
 
         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')