diff options
author | Georg Brandl <georg@python.org> | 2013-10-27 06:46:09 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2013-10-27 06:46:09 (GMT) |
commit | b89b5df9c9aa2e45bfffa95f5e3deb6234232c93 (patch) | |
tree | fd9bfa96b2e5cbc69acc235dd15dd682c10fc00e /Lib/test/test_imaplib.py | |
parent | 68457be619b919127d0858322ce84e901fd89728 (diff) | |
parent | 045ee06ae91a1503a8d512929c54e16deabfe9a8 (diff) | |
download | cpython-b89b5df9c9aa2e45bfffa95f5e3deb6234232c93.zip cpython-b89b5df9c9aa2e45bfffa95f5e3deb6234232c93.tar.gz cpython-b89b5df9c9aa2e45bfffa95f5e3deb6234232c93.tar.bz2 |
merge with 3.3
Diffstat (limited to 'Lib/test/test_imaplib.py')
-rw-r--r-- | Lib/test/test_imaplib.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_imaplib.py b/Lib/test/test_imaplib.py index c37ea1d..81bfd1f 100644 --- a/Lib/test/test_imaplib.py +++ b/Lib/test/test_imaplib.py @@ -325,6 +325,17 @@ class BaseThreadedNetworkedTests(unittest.TestCase): self.assertEqual(ret, "OK") + def test_linetoolong(self): + class TooLongHandler(SimpleIMAPHandler): + def handle(self): + # Send a very long response line + self.wfile.write(b'* OK ' + imaplib._MAXLINE*b'x' + b'\r\n') + + with self.reaped_server(TooLongHandler) as server: + self.assertRaises(imaplib.IMAP4.error, + self.imap_class, *server.server_address) + + class ThreadedNetworkedTests(BaseThreadedNetworkedTests): server_class = socketserver.TCPServer |