summaryrefslogtreecommitdiff
path: root/Lib/test/test_quopri.py
diff options
context:
space:
mode:
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 0e997271fc..2497705a2d 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)