summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2006-04-14 14:03:55 (GMT)
committerWalter Dörwald <walter@livinglogic.de>2006-04-14 14:03:55 (GMT)
commit15be5ec100dd4dc9718978dc3f00c83154af590e (patch)
treeffc400e522deee620a240655309a42c0fd8c3498 /Lib/test
parent121c98cce153894d4db5fc9bc2f57cf2a6a78aec (diff)
downloadcpython-15be5ec100dd4dc9718978dc3f00c83154af590e.zip
cpython-15be5ec100dd4dc9718978dc3f00c83154af590e.tar.gz
cpython-15be5ec100dd4dc9718978dc3f00c83154af590e.tar.bz2
Call encode()/decode() with final==True as the last call in the
incremental codec tests.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_codecs.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_codecs.py b/Lib/test/test_codecs.py
index 49b534c..22d9060 100644
--- a/Lib/test/test_codecs.py
+++ b/Lib/test/test_codecs.py
@@ -1044,20 +1044,24 @@ class BasicUnicodeTest(unittest.TestCase):
encodedresult = ""
for c in s:
encodedresult += encoder.encode(c)
+ encodedresult += encoder.encode(u"", True)
decoder = codecs.getincrementaldecoder(encoding)()
decodedresult = u""
for c in encodedresult:
decodedresult += decoder.decode(c)
+ decodedresult += decoder.decode("", True)
self.assertEqual(decodedresult, s, "%r != %r (encoding=%r)" % (decodedresult, s, encoding))
# check C API
encodedresult = ""
for c in s:
encodedresult += cencoder.encode(c)
+ encodedresult += cencoder.encode(u"", True)
cdecoder = _testcapi.codec_incrementaldecoder(encoding)
decodedresult = u""
for c in encodedresult:
decodedresult += cdecoder.decode(c)
+ decodedresult += cdecoder.decode("", True)
self.assertEqual(decodedresult, s, "%r != %r (encoding=%r)" % (decodedresult, s, encoding))
# check iterencode()/iterdecode()