summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncore.py
diff options
context:
space:
mode:
authorJosiah Carlson <josiah.carlson@gmail.com>2008-07-07 04:51:46 (GMT)
committerJosiah Carlson <josiah.carlson@gmail.com>2008-07-07 04:51:46 (GMT)
commitff5f42088bdbe9fe801a52ba3a9d63bbaacdf2a2 (patch)
tree3b3f592891450032d0f3769d70540434550627d3 /Lib/test/test_asyncore.py
parent3b1e6b2f833d1e030b2ff853e1a942dc0de968f5 (diff)
downloadcpython-ff5f42088bdbe9fe801a52ba3a9d63bbaacdf2a2.zip
cpython-ff5f42088bdbe9fe801a52ba3a9d63bbaacdf2a2.tar.gz
cpython-ff5f42088bdbe9fe801a52ba3a9d63bbaacdf2a2.tar.bz2
Fixed bugs 760475, 953599, and 1519.
Diffstat (limited to 'Lib/test/test_asyncore.py')
-rw-r--r--Lib/test/test_asyncore.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/Lib/test/test_asyncore.py b/Lib/test/test_asyncore.py
index 4879770..36096ef 100644
--- a/Lib/test/test_asyncore.py
+++ b/Lib/test/test_asyncore.py
@@ -38,6 +38,7 @@ class exitingdummy:
raise asyncore.ExitNow()
handle_write_event = handle_read_event
+ handle_close_event = handle_read_event
handle_expt_event = handle_read_event
class crashingdummy:
@@ -48,6 +49,7 @@ class crashingdummy:
raise Exception()
handle_write_event = handle_read_event
+ handle_close_event = handle_read_event
handle_expt_event = handle_read_event
def handle_error(self):
@@ -117,6 +119,7 @@ class HelperFunctionTests(unittest.TestCase):
def __init__(self):
self.read = False
self.write = False
+ self.closed = False
self.expt = False
def handle_read_event(self):
@@ -125,6 +128,9 @@ class HelperFunctionTests(unittest.TestCase):
def handle_write_event(self):
self.write = True
+ def handle_close_event(self):
+ self.closed = True
+
def handle_expt_event(self):
self.expt = True
@@ -167,9 +173,9 @@ class HelperFunctionTests(unittest.TestCase):
for flag in (select.POLLERR, select.POLLHUP, select.POLLNVAL):
tobj = testobj()
- self.assertEqual(tobj.expt, False)
+ self.assertEqual((tobj.expt, tobj.closed)[flag == select.POLLHUP], False)
asyncore.readwrite(tobj, flag)
- self.assertEqual(tobj.expt, True)
+ self.assertEqual((tobj.expt, tobj.closed)[flag == select.POLLHUP], True)
# check that ExitNow exceptions in the object handler method
# bubbles all the way up through asyncore readwrite calls