summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_poplib.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_poplib.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_poplib.py')
-rw-r--r--Lib/test/test_poplib.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/Lib/test/test_poplib.py b/Lib/test/test_poplib.py
index 935848b..dd51ac9 100644
--- a/Lib/test/test_poplib.py
+++ b/Lib/test/test_poplib.py
@@ -94,7 +94,7 @@ class DummyPOP3Handler(asynchat.async_chat):
def cmd_list(self, arg):
if arg:
- self.push('+OK %s %s' %(arg, arg))
+ self.push('+OK %s %s' % (arg, arg))
else:
self.push('+OK')
asynchat.async_chat.push(self, LIST_RESP)
@@ -278,6 +278,10 @@ class TestPOP3Class(TestCase):
foo = self.client.retr('foo')
self.assertEqual(foo, expected)
+ def test_too_long_lines(self):
+ self.assertRaises(poplib.error_proto, self.client._shortcmd,
+ 'echo +%s' % ((poplib._MAXLINE + 10) * 'a'))
+
def test_dele(self):
self.assertOK(self.client.dele('foo'))
@@ -400,7 +404,13 @@ if SUPPORTS_SSL:
def tearDown(self):
if self.client.file is not None and self.client.sock is not None:
- self.client.quit()
+ try:
+ self.client.quit()
+ except poplib.error_proto:
+ # happens in the test_too_long_lines case; the overlong
+ # response will be treated as response to QUIT and raise
+ # this exception
+ pass
self.server.stop()
def test_stls(self):