'If it is not possible to encode a response to the request (for example,
because L{xmlrpclib.dumps} raises an exception when encoding a
L{Fault}) the exception which prevents the response from being
generated is logged and the request object is finished anyway.'

def test_doubleEncodingError(self):

    d = self.proxy().callRemote('echo', '')
    def fakeDumps(*args, **kwargs):
        raise RuntimeError('Cannot    encode    anything    at    all!')
    self.patch(xmlrpclib, 'dumps', fakeDumps)
    d = self.assertFailure(d, Exception)
    def cbFailed(ignored):
        self.assertEqual(len(self.flushLoggedErrors(RuntimeError)), 1)
    d.addCallback(cbFailed)
    return d
