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.
This commit is contained in:
Amaury Forgeot d'Arc 2007-11-20 23:31:27 +00:00
parent 8c4592a77a
commit 5087980c1e
5 changed files with 61 additions and 23 deletions

View file

@ -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):