summaryrefslogtreecommitdiff
path: root/Lib/test/test_email
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2011-03-23 15:37:26 -0400
committerR David Murray <rdmurray@bitdance.com>2011-03-23 15:37:26 -0400
commit5839b9635cd582a5a2660605a48bddafab44aa06 (patch)
treee5ef72dc91632ad969f80a41c8aeb644b43a8dd8 /Lib/test/test_email
parent6ab79d9d5bed43e6e2d6b1b27ab319c02fa1716a (diff)
parent523b41c4b3fe79455fc9d1762056ca3e83972aa1 (diff)
downloadcpython-git-5839b9635cd582a5a2660605a48bddafab44aa06.tar.gz
Merge #11590: fix quoprimime decode handling of empty strings and line endings.
Diffstat (limited to 'Lib/test/test_email')
-rw-r--r--Lib/test/test_email/test_email.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/Lib/test/test_email/test_email.py b/Lib/test/test_email/test_email.py
index 79a7a252f1..bc6a309861 100644
--- a/Lib/test/test_email/test_email.py
+++ b/Lib/test/test_email/test_email.py
@@ -3351,6 +3351,9 @@ class TestQuopri(unittest.TestCase):
encoded_header = quoprimime.header_encode(header, charset)
self.assertEqual(encoded_header, expected_encoded_header)
+ def test_header_encode_null(self):
+ self._test_header_encode(b'', '')
+
def test_header_encode_one_word(self):
self._test_header_encode(b'hello', '=?iso-8859-1?q?hello?=')
@@ -3407,6 +3410,15 @@ class TestQuopri(unittest.TestCase):
def test_decode_one_line_lf(self):
self._test_decode('hello\n', 'hello\n')
+ def test_decode_one_line_cr(self):
+ self._test_decode('hello\r', 'hello\n')
+
+ def test_decode_one_line_nl(self):
+ self._test_decode('hello\n', 'helloX', eol='X')
+
+ def test_decode_one_line_crnl(self):
+ self._test_decode('hello\r\n', 'helloX', eol='X')
+
def test_decode_one_line_one_word(self):
self._test_decode('hello\r\nworld', 'hello\nworld')
@@ -3416,6 +3428,9 @@ class TestQuopri(unittest.TestCase):
def test_decode_two_lines(self):
self._test_decode('hello\r\nworld\r\n', 'hello\nworld\n')
+ def test_decode_two_lines_eol(self):
+ self._test_decode('hello\r\nworld\r\n', 'helloXworldX', eol='X')
+
def test_decode_one_long_line(self):
self._test_decode('Spam' * 250, 'Spam' * 250)