def test_present(self): select = self.klass() recv = mitogen.core.Receiver(self.router) select.add(recv) select.remove(recv) self.assertEquals(0, len(select._receivers)) self.assertEquals(None, recv.notify)
def test_latch_present(self): select = self.klass() latch = mitogen.core.Latch() select.add(latch) select.remove(latch) self.assertEquals(0, len(select._receivers)) self.assertEquals(None, latch.notify)
def test_present(self): select = self.klass() recv = mitogen.core.Receiver(self.router) select.add(recv) select.remove(recv) self.assertEquals(0, len(select._receivers)) self.assertEquals(None, recv.notify)
def test_absent(self): select = self.klass() recv = mitogen.core.Receiver(self.router) recv2 = mitogen.core.Receiver(self.router) select.add(recv2) exc = self.assertRaises(mitogen.select.Error, lambda: select.remove(recv)) self.assertEquals(str(exc), self.klass.not_present_msg)
def test_latch_absent(self): select = self.klass() latch = mitogen.core.Latch() latch2 = mitogen.core.Latch() select.add(latch2) exc = self.assertRaises(mitogen.select.Error, lambda: select.remove(latch)) self.assertEquals(str(exc), self.klass.not_present_msg)
def test_absent(self): select = self.klass() recv = mitogen.core.Receiver(self.router) recv2 = mitogen.core.Receiver(self.router) select.add(recv2) exc = self.assertRaises(mitogen.select.Error, lambda: select.remove(recv)) self.assertEquals(str(exc), self.klass.not_present_msg)