mirror of
https://github.com/python/cpython.git
synced 2025-09-17 22:20:23 +00:00
Add test for fix of issue #1730114.
This commit is contained in:
parent
47fb192dda
commit
a5016cd0f7
1 changed files with 8 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue