def test_requestResponseCodeMessage(self):
    "\n        The response code and message can be set by the request object passed to\n        a distributed resource's C{render} method.\n        "

    class SetResponseCode(resource.Resource):

        def render(self, request):
            request.setResponseCode(200, b'some-message')
            return ''
    request = self._requestAgentTest(SetResponseCode())

    def cbRequested(result):
        self.assertEqual(result[0].data, b'')
        self.assertEqual(result[1].code, 200)
        self.assertEqual(result[1].phrase, b'some-message')
    request.addCallback(cbRequested)
    return request
The response code and message can be set by the request object passed to
a distributed resource's C{render} method.
def test_requestResponseCodeMessage(self):
    "\n        The response code and message can be set by the request object passed to\n        a distributed resource's C{render} method.\n        "

    class SetResponseCode(resource.Resource):

        def render(self, request):
            request.setResponseCode(200, b'some-message')
            return 
    request = self._requestAgentTest(SetResponseCode())

    def cbRequested(result):
        self.assertEqual(result[0].data, b)
        self.assertEqual(result[1].code, 200)
        self.assertEqual(result[1].phrase, b'some-message')
    request.addCallback(cbRequested)
    return request