summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_imaplib.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2013-10-27 06:46:09 (GMT)
committerGeorg Brandl <georg@python.org>2013-10-27 06:46:09 (GMT)
commitb89b5df9c9aa2e45bfffa95f5e3deb6234232c93 (patch)
treefd9bfa96b2e5cbc69acc235dd15dd682c10fc00e /Lib/test/test_imaplib.py
parent68457be619b919127d0858322ce84e901fd89728 (diff)
parent045ee06ae91a1503a8d512929c54e16deabfe9a8 (diff)
downloadcpython-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.py11
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