Пример #1
0
    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)
Пример #2
0
    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)