summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_hashlib.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_hashlib.py')
-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 2857737..7d58da9 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
from io import StringIO
+import itertools
import sys
try:
import threading
@@ -93,6 +95,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.values()
+ 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')