'When an XML-RPC method is called and the implementation is
decorated with L{withRequest}, the request object is passed as
the first argument.'

def test_withRequest(self):

    request = DummyRequest('/RPC2')
    request.method = 'POST'
    request.content = NativeStringIO(xmlrpclib.dumps(('foo',), 'withRequest'))
    def valid(n, request):
        data = xmlrpclib.loads(request.written[0])
        self.assertEqual(data, (('POST    foo',), None))
    d = request.notifyFinish().addCallback(valid, request)
    self.resource.render_POST(request)
    return d
