summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_io.py
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-05-03 12:21:13 (GMT)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-05-03 12:21:13 (GMT)
commit7684f852972901b2e55be898f316095c3acf51bc (patch)
treefa855aa9dfa7817548b203d1169b31a0e6d26719 /Lib/test/test_io.py
parent64a4bbeb259026e6bb3e4a8864870b1ed35ffab2 (diff)
downloadcpython-7684f852972901b2e55be898f316095c3acf51bc.zip
cpython-7684f852972901b2e55be898f316095c3acf51bc.tar.gz
cpython-7684f852972901b2e55be898f316095c3acf51bc.tar.bz2
In test_io, StatefulIncrementalDecoderTest was not part of the test suite.
And of course, the test failed: a bytearray was used without reason in io.TextIOWrapper.tell(). The difference is that iterating over bytes (i.e. str in python2.6) returns 1-char bytes, whereas bytearrays yield integers. This code should still work with python3.0
Diffstat (limited to 'Lib/test/test_io.py')
-rw-r--r--Lib/test/test_io.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py
index 7110259..e193834 100644
--- a/Lib/test/test_io.py
+++ b/Lib/test/test_io.py
@@ -560,9 +560,9 @@ class StatefulIncrementalDecoder(codecs.IncrementalDecoder):
def process_word(self):
output = ''
- if self.buffer[0] == 'i':
+ if self.buffer[0] == ord('i'):
self.i = min(99, int(self.buffer[1:] or 0)) # set input length
- elif self.buffer[0] == 'o':
+ elif self.buffer[0] == ord('o'):
self.o = min(99, int(self.buffer[1:] or 0)) # set output length
else:
output = self.buffer.decode('ascii')
@@ -1160,10 +1160,10 @@ class MiscIOTest(unittest.TestCase):
def test_main():
test_support.run_unittest(IOTest, BytesIOTest, StringIOTest,
- BufferedReaderTest,
- BufferedWriterTest, BufferedRWPairTest,
- BufferedRandomTest, TextIOWrapperTest,
- MiscIOTest)
+ BufferedReaderTest, BufferedWriterTest,
+ BufferedRWPairTest, BufferedRandomTest,
+ StatefulIncrementalDecoderTest,
+ TextIOWrapperTest, MiscIOTest)
if __name__ == "__main__":
unittest.main()