Пример #1
0
 def test_is_disconnection_error_with_could_not_receive_data(self):
     """
     If the underlying driver raises an OperationalError with 'could not
     receive data from server', we consider the connection
     dead and mark it as needing reconnection.
     """
     exc = OperationalError("could not receive data from server")
     self.assertTrue(self.connection.is_disconnection_error(exc))
Пример #2
0
 def test_is_disconnection_error_with_could_not_send_data(self):
     """
     If the underlying driver raises an OperationalError with 'could not
     send data to server', we consider the connection
     dead and mark it as needing reconnection.
     """
     exc = OperationalError("could not send data to server")
     assert self.connection.is_disconnection_error(exc)
Пример #3
0
 def test_operationalerror_view(self):
     request = LaunchpadTestRequest()
     OperationalErrorView(OperationalError(), request)
     self.assertEquals(503, request.response.getStatus())
Пример #4
0
 def __call__(self, *args, **kw):
     raise OperationalError()