mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Issue #16473: Fix byte transform codec documentation; test quotetabs=True
This changes the equivalent functions listed for the Base-64, hex and Quoted- Printable codecs to reflect the functions actually used. Also mention and test the "quotetabs" setting for Quoted-Printable encoding.
This commit is contained in:
parent
f9b6875259
commit
06171bd52a
3 changed files with 17 additions and 9 deletions
|
|
@ -2613,6 +2613,14 @@ class TransformCodecTest(unittest.TestCase):
|
|||
info = codecs.lookup(alias)
|
||||
self.assertEqual(info.name, expected_name)
|
||||
|
||||
def test_quopri_stateless(self):
|
||||
# Should encode with quotetabs=True
|
||||
encoded = codecs.encode(b"space tab\teol \n", "quopri-codec")
|
||||
self.assertEqual(encoded, b"space=20tab=09eol=20\n")
|
||||
# But should still support unescaped tabs and spaces
|
||||
unescaped = b"space tab eol\n"
|
||||
self.assertEqual(codecs.decode(unescaped, "quopri-codec"), unescaped)
|
||||
|
||||
def test_uu_invalid(self):
|
||||
# Missing "begin" line
|
||||
self.assertRaises(ValueError, codecs.decode, b"", "uu-codec")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue