]> granicus.if.org Git - python/commitdiff
Add test for fix of issue #1730114.
authorAntoine Pitrou <solipsis@pitrou.net>
Fri, 21 Oct 2011 20:22:04 +0000 (22:22 +0200)
committerAntoine Pitrou <solipsis@pitrou.net>
Fri, 21 Oct 2011 20:22:04 +0000 (22:22 +0200)
Lib/test/test_StringIO.py

index 76fc3d76e101de4c540e88e9818ea202b96fc69e..ed8690c4e772a258f1680e828aa2b7ca8ccd451a 100644 (file)
@@ -4,6 +4,7 @@ import unittest
 import StringIO
 import cStringIO
 import types
+import array
 from test import test_support
 
 
@@ -127,6 +128,13 @@ class TestStringIO(TestGenericStringIO):
 class TestcStringIO(TestGenericStringIO):
     MODULE = cStringIO
 
+    def test_array_support(self):
+        # Issue
+        a = array.array('B', [0,1,2])
+        f = self.MODULE.StringIO(a)
+        self.assertEqual(f.getvalue(), '\x00\x01\x02')
+
+
 import sys
 if sys.platform.startswith('java'):
     # Jython doesn't have a buffer object, so we just do a useless