def test_02(self): """ write add """ dp = _iodispatcher() fo = socket.socket() dp.when_write(fo, self.on_write) assert dp._events[0].fo == fo fo.close()
def test_04(self): """ call write """ dp = _iodispatcher() fo = socket.socket() dp.when_read(fo, self.on_read, 3000) dp._events[0]._call() assert self.revent.fo == fo assert self.rvalue == 3000 fo.close()