Пример #1
0
 def test_drain_error_EAGAIN(self):
     exc = KeyError()
     exc.errno = errno.EAGAIN
     self.connection.drain_events.side_effect = exc
     _quick_drain(self.connection, timeout=33.3)
Пример #2
0
 def test_drain_error(self):
     exc = KeyError()
     exc.errno = 313
     self.connection.drain_events.side_effect = exc
     with pytest.raises(KeyError):
         _quick_drain(self.connection, timeout=33.3)
Пример #3
0
 def test_drain(self):
     _quick_drain(self.connection, timeout=33.3)
     self.connection.drain_events.assert_called_with(timeout=33.3)
Пример #4
0
 def test_drain_error_EAGAIN(self):
     exc = KeyError()
     exc.errno = errno.EAGAIN
     self.connection.drain_events.side_effect = exc
     _quick_drain(self.connection, timeout=33.3)
Пример #5
0
 def test_drain_error(self):
     exc = KeyError()
     exc.errno = 313
     self.connection.drain_events.side_effect = exc
     with self.assertRaises(KeyError):
         _quick_drain(self.connection, timeout=33.3)
Пример #6
0
 def test_drain(self):
     _quick_drain(self.connection, timeout=33.3)
     self.connection.drain_events.assert_called_with(timeout=33.3)