diff options
author | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2007-11-20 23:31:27 (GMT) |
---|---|---|
committer | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2007-11-20 23:31:27 (GMT) |
commit | 5087980c1e7e6733983245cd0f209d8770f9686e (patch) | |
tree | 21cb48e04503c87abd856791ba2a249a40ff1433 /Lib/test | |
parent | 8c4592a77ae6b71a4bab8d40bbdcea72a6378cb4 (diff) | |
download | cpython-5087980c1e7e6733983245cd0f209d8770f9686e.zip cpython-5087980c1e7e6733983245cd0f209d8770f9686e.tar.gz cpython-5087980c1e7e6733983245cd0f209d8770f9686e.tar.bz2 |
The incremental decoder for utf-7 must preserve its state between calls.
Solves issue1460.
Might not be a backport candidate: a new API function was added,
and some code may rely on details in utf-7.py.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_codecs.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/Lib/test/test_codecs.py b/Lib/test/test_codecs.py index bfb417c..cee819c 100644 --- a/Lib/test/test_codecs.py +++ b/Lib/test/test_codecs.py @@ -51,7 +51,7 @@ class ReadTest(unittest.TestCase): self.assertEqual(d.decode("", True), u"") self.assertEqual(d.buffer, "") - # Check whether the rest method works properly + # Check whether the reset method works properly d.reset() result = u"" for (c, partialresult) in zip(input.encode(self.encoding), partialresults): @@ -491,7 +491,17 @@ class UTF8Test(ReadTest): class UTF7Test(ReadTest): encoding = "utf-7" - # No test_partial() yet, because UTF-7 doesn't support it. + def test_partial(self): + self.check_partial( + u"a+-b", + [ + u"a", + u"a", + u"a+", + u"a+-", + u"a+-b", + ] + ) class UTF16ExTest(unittest.TestCase): |