diff options
author | Georg Brandl <georg@python.org> | 2009-07-16 07:18:07 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2009-07-16 07:18:07 (GMT) |
commit | d77faaf48f1469cb212937e37fcf8c3a35fa3c22 (patch) | |
tree | 43bbe32975fcda3b1c85e8e68a7e2c0be6fe32ed /Lib | |
parent | b9ee881f8bd92bc3aac4ae8072d148f3166770ec (diff) | |
download | cpython-d77faaf48f1469cb212937e37fcf8c3a35fa3c22.zip cpython-d77faaf48f1469cb212937e37fcf8c3a35fa3c22.tar.gz cpython-d77faaf48f1469cb212937e37fcf8c3a35fa3c22.tar.bz2 |
#5910: fix kqueue for calls with more than one event.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_kqueue.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Lib/test/test_kqueue.py b/Lib/test/test_kqueue.py index 901295b..a0ab860 100644 --- a/Lib/test/test_kqueue.py +++ b/Lib/test/test_kqueue.py @@ -162,6 +162,22 @@ class TestKQueue(unittest.TestCase): server.close() serverSocket.close() + def testPair(self): + kq = select.kqueue() + a, b = socket.socketpair() + + a.send(b'foo') + event1 = select.kevent(a, select.KQ_FILTER_READ, select.KQ_EV_ADD | select.KQ_EV_ENABLE) + event2 = select.kevent(b, select.KQ_FILTER_READ, select.KQ_EV_ADD | select.KQ_EV_ENABLE) + r = kq.control([event1, event2], 1, 1) + self.assertTrue(r) + self.assertFalse(r[0].flags & select.KQ_EV_ERROR) + self.assertEquals(b.recv(r[0].data), b'foo') + + a.close() + b.close() + kq.close() + def test_main(): test_support.run_unittest(TestKQueue) |