summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asynchat.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-07-07 22:26:36 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2014-07-07 22:26:36 (GMT)
commit630a4f63c539345a6432d6177931b5fcc2f18aa7 (patch)
treebed6342759b5925823a2ae7ece387925ad263ce2 /Lib/test/test_asynchat.py
parentfd5d1b51d64280d938b7cdc9d78c632b21b45dff (diff)
downloadcpython-630a4f63c539345a6432d6177931b5fcc2f18aa7.zip
cpython-630a4f63c539345a6432d6177931b5fcc2f18aa7.tar.gz
cpython-630a4f63c539345a6432d6177931b5fcc2f18aa7.tar.bz2
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 3471739..84867ec 100644
--- a/Lib/test/test_asynchat.py
+++ b/Lib/test/test_asynchat.py
@@ -304,5 +304,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()