def test_select3(self):
import select
import socket
s1, s2 = socket.socketpair()
with hub.Timeout(1, MyException):
list = [s1.fileno(), s2.fileno()]
rlist, wlist, xlist = select.select(list, list, list)
assert not s1.fileno() in rlist
assert not s2.fileno() in rlist
# the following two assertions are commented out because one of
# them fails with eventlet-patched select.
# assert s1.fileno() in wlist
# assert s2.fileno() in wlist
# note: eventlet-patched select returns at most one file.
assert (s1.fileno() in wlist) or (s2.fileno() in wlist)
assert not s1.fileno() in xlist
assert not s2.fileno() in xlist
评论列表
文章目录