def test_Error(self): context = Mock() r = Response.Error(123, context, "Test Error") self.assertEquals(123, r.id_) self.assertEquals("Error", r.type_) self.assertEquals(context, r.context)
def respond_with_error(self, message): """ Create an Error Response object to handle the request Args: message(str): Message explaining error """ response = Response.Error(self.id_, self.context, message=message) self.response_queue.put(response)