Index: Lib/test/test_imaplib.py =================================================================== --- Lib/test/test_imaplib.py (revision 71980) +++ Lib/test/test_imaplib.py (working copy) @@ -4,8 +4,23 @@ from test import test_support import unittest +class DummyIMAP(imaplib.IMAP4): + def __init__(self): + """Skip connections, for testing.""" + pass + def _simple_command(self, name, *args): + """Return self.literal, for testing methods affecting literal.""" + return self.literal + class TestImaplib(unittest.TestCase): + # CR, LF in literal should not be replaced by CRLF, issue 5430 + def test_cr_lf_literal_preservation(self): + i = DummyIMAP() + teststr = 'one\rtwo\nthree\r\n' + result = i.append(None, None, None, teststr) + self.assertEqual(teststr, result) + def test_that_Time2Internaldate_returns_a_result(self): # We can check only that it successfully produces a result, # not the correctness of the result itself, since the result