Skip to content

Commit 948421f

Browse files
Add tests for quoprimime.decode() with eol=CRLF
1 parent 9b34b5c commit 948421f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Lib/test/test_email/test_email.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4828,6 +4828,17 @@ def test_decode_soft_line_break(self):
48284828
def test_decode_false_quoting(self):
48294829
self._test_decode('A=1,B=A ==> A+B==2', 'A=1,B=A ==> A+B==2')
48304830

4831+
def test_decode_crlf_eol_no_trailing_newline(self):
4832+
# decode() with eol='\r\n' should not leave a stray \r
4833+
# when the input has no trailing line ending.
4834+
self._test_decode('abc', 'abc', eol='\r\n')
4835+
4836+
def test_decode_crlf_eol_multiline_no_trailing_newline(self):
4837+
self._test_decode('a\r\nb', 'a\r\nb', eol='\r\n')
4838+
4839+
def test_decode_crlf_eol_with_trailing_newline(self):
4840+
self._test_decode('abc\r\n', 'abc\r\n', eol='\r\n')
4841+
48314842
def _test_encode(self, body, expected_encoded_body, maxlinelen=None, eol=None):
48324843
kwargs = {}
48334844
if maxlinelen is None:

0 commit comments

Comments
 (0)