summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_quopri.py
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2001-09-30 20:32:11 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2001-09-30 20:32:11 (GMT)
commit16dc7f44b1116aab58897bc7e94cb972488206fc (patch)
treeb1e90d9ca27e6dbdd0cd6b6d66fcb8a333a746a3 /Lib/test/test_quopri.py
parent5f12d755a82312673c35e8224b2bde7ced159c52 (diff)
downloadcpython-16dc7f44b1116aab58897bc7e94cb972488206fc.zip
cpython-16dc7f44b1116aab58897bc7e94cb972488206fc.tar.gz
cpython-16dc7f44b1116aab58897bc7e94cb972488206fc.tar.bz2
Patch #462190, patch #464070: Support quoted printable in the binascii module.
Decode and encode underscores for header style encoding. Fixes bug #463996.
Diffstat (limited to 'Lib/test/test_quopri.py')
-rw-r--r--Lib/test/test_quopri.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/test_quopri.py b/Lib/test/test_quopri.py
index 0e99727..2497705 100644
--- a/Lib/test/test_quopri.py
+++ b/Lib/test/test_quopri.py
@@ -104,6 +104,12 @@ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz''')
('hello\tworld', 'hello=09world'),
)
+ # These are used in the "header=1" tests.
+ HSTRINGS = (
+ ('hello world', 'hello_world'),
+ ('hello_world', 'hello=5Fworld'),
+ )
+
def test_encodestring(self):
for p, e in self.STRINGS:
self.assert_(encodestring(p) == e)
@@ -135,6 +141,13 @@ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz''')
self.assert_(encodestring(p, quotetabs=1) == e)
self.assert_(decodestring(e) == p)
+ def test_encode_header(self):
+ for p, e in self.HSTRINGS:
+ self.assert_(encodestring(p, header = 1) == e)
+
+ def test_decode_header(self):
+ for p, e in self.HSTRINGS:
+ self.assert_(decodestring(e, header = 1) == p)
def test_main():
test_support.run_unittest(QuopriTestCase)