summaryrefslogtreecommitdiff
path: root/Lib/test/test_asynchat.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-07-08 00:34:48 +0200
committerVictor Stinner <victor.stinner@gmail.com>2014-07-08 00:34:48 +0200
commitdb5f8fcde69d7f16261cfd763cd74a7e5e2d1383 (patch)
tree4b542ca21cee72240d4e68c23b10b7b97fb23e54 /Lib/test/test_asynchat.py
parent7b9328f51bee311ff943af660f3b5f1b35d4e196 (diff)
parent630a4f63c539345a6432d6177931b5fcc2f18aa7 (diff)
downloadcpython-git-db5f8fcde69d7f16261cfd763cd74a7e5e2d1383.tar.gz
(Merge 3.4) Issue #11259: asynchat.async_chat().set_terminator() now raises a
ValueError if the number of received bytes is negative.
Diffstat (limited to 'Lib/test/test_asynchat.py')
-rw-r--r--Lib/test/test_asynchat.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_asynchat.py b/Lib/test/test_asynchat.py
index f6b17f9f36..9e305731ed 100644
--- a/Lib/test/test_asynchat.py
+++ b/Lib/test/test_asynchat.py
@@ -311,5 +311,13 @@ class TestFifo(unittest.TestCase):
self.assertEqual(f.pop(), (0, None))
+class TestNotConnected(unittest.TestCase):
+ def test_disallow_negative_terminator(self):
+ # Issue #11259
+ client = asynchat.async_chat()
+ self.assertRaises(ValueError, client.set_terminator, -1)
+
+
+
if __name__ == "__main__":
unittest.main()