mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
Issue #16473: Merge codecs doc and test from 3.4 into 3.5
This commit is contained in:
commit
9ab96946ee
3 changed files with 17 additions and 9 deletions
|
@ -2684,6 +2684,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