def test_receiver(self): recv = mitogen.core.Receiver(self.router) recv._on_receive(mitogen.core.Message.pickled('123')) select = self.klass([recv]) event = select.get_event() self.assertEquals(recv, event.source) self.assertEquals('123', event.data.unpickle())
def test_latch(self): latch = mitogen.core.Latch() latch.put(123) select = self.klass([latch]) event = select.get_event() self.assertEquals(latch, event.source) self.assertEquals(123, event.data)