def test_errorXMLContent(self):
        """
        Test that an invalid XML input returns an L{xmlrpc.Fault}.
        """
        agent = client.Agent(reactor)
        d = agent.request(
            uri=networkString("http://127.0.0.1:%d/" % (self.port,)),
            method=b"POST",
            bodyProducer=client.FileBodyProducer(BytesIO(b"foo")))
        d.addCallback(client.readBody)
        def cb(result):
            self.assertRaises(xmlrpc.Fault, xmlrpclib.loads, result)
        d.addCallback(cb)
        return d

        Test that an invalid XML input returns an L{xmlrpc.Fault}.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_xmlrpc.py