summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_codecs.py
diff options
context:
space:
mode:
authorHye-Shik Chang <hyeshik@gmail.com>2004-10-17 23:51:21 (GMT)
committerHye-Shik Chang <hyeshik@gmail.com>2004-10-17 23:51:21 (GMT)
commitaf5c7cff56f15432464f6058d7116ce9359abee5 (patch)
tree9144b925c287e93506266748aa0ac608a169b9dc /Lib/test/test_codecs.py
parenta5c64599d547565c48275601b67322aa3ef04c8b (diff)
downloadcpython-af5c7cff56f15432464f6058d7116ce9359abee5.zip
cpython-af5c7cff56f15432464f6058d7116ce9359abee5.tar.gz
cpython-af5c7cff56f15432464f6058d7116ce9359abee5.tar.bz2
SF #1048865: Fix a trivial typo that breaks StreamReader.readlines()
Diffstat (limited to 'Lib/test/test_codecs.py')
-rw-r--r--Lib/test/test_codecs.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/Lib/test/test_codecs.py b/Lib/test/test_codecs.py
index 524c247..54d9da5 100644
--- a/Lib/test/test_codecs.py
+++ b/Lib/test/test_codecs.py
@@ -458,6 +458,16 @@ class CodecsModuleTest(unittest.TestCase):
self.assertEquals(codecs.encode(u'\xe4\xf6\xfc', 'latin-1'),
'\xe4\xf6\xfc')
+class StreamReaderTest(unittest.TestCase):
+
+ def setUp(self):
+ self.reader = codecs.getreader('utf-8')
+ self.stream = StringIO.StringIO('\xed\x95\x9c\n\xea\xb8\x80')
+
+ def test_readlines(self):
+ f = self.reader(self.stream)
+ self.assertEquals(f.readlines(), [u'\ud55c\n', u'\uae00'])
+
def test_main():
test_support.run_unittest(
UTF16Test,
@@ -469,7 +479,8 @@ def test_main():
PunycodeTest,
NameprepTest,
CodecTest,
- CodecsModuleTest
+ CodecsModuleTest,
+ StreamReaderTest
)