[Python-checkins] cpython (2.7): Add test for fix of issue #1730114.
antoine.pitrou
python-checkins at python.org
Fri Oct 21 22:26:06 CEST 2011
http://hg.python.org/cpython/rev/c91661e0d714
changeset: 73045:c91661e0d714
branch: 2.7
parent: 73037:d2f303861c98
user: Antoine Pitrou <solipsis at pitrou.net>
date: Fri Oct 21 22:22:04 2011 +0200
summary:
Add test for fix of issue #1730114.
files:
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
--- a/Lib/test/test_StringIO.py
+++ b/Lib/test/test_StringIO.py
@@ -4,6 +4,7 @@
import StringIO
import cStringIO
import types
+import array
from test import test_support
@@ -127,6 +128,13 @@
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
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list