diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2011-10-21 20:22:04 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-10-21 20:22:04 (GMT) |
commit | a5016cd0f7cc9a549e989299c659d9ddc7b23da5 (patch) | |
tree | 51fa9748025b6d4154d550320fe9e2e9e52e89a3 /Lib/test/test_StringIO.py | |
parent | 47fb192ddafa48e3408c054c4ac1b1dc976164db (diff) | |
download | cpython-a5016cd0f7cc9a549e989299c659d9ddc7b23da5.zip cpython-a5016cd0f7cc9a549e989299c659d9ddc7b23da5.tar.gz cpython-a5016cd0f7cc9a549e989299c659d9ddc7b23da5.tar.bz2 |
Add test for fix of issue #1730114.
Diffstat (limited to 'Lib/test/test_StringIO.py')
-rw-r--r-- | Lib/test/test_StringIO.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_StringIO.py b/Lib/test/test_StringIO.py index 76fc3d7..ed8690c 100644 --- a/Lib/test/test_StringIO.py +++ b/Lib/test/test_StringIO.py @@ -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 |