def test_add_raises_ValueError(self): hub = Hub() hub.poller = Mock(name='hub.poller') hub.poller.register.side_effect = ValueError() hub._discard = Mock(name='hub.discard') hub.add(2, Mock(), READ) hub._discard.assert_called_with(2)
def test_remove__unregister_raises(self): hub = Hub() hub.poller = Mock() hub.poller.unregister.side_effect = OSError() hub.remove(313)
def test_can_remove_unknown_fds(self): hub = Hub() hub.poller = Mock() hub.remove(30) hub.remove(File(301))