def test_headers(self):
        """
        Verify that headers sent from the client side and the ones we
        get back from the server side are correct.

        """
        d = self.proxy().callRemote("snowman", u"\u2603")

        def check_server_headers(ing):
            self.assertEqual(
                self.factories[0].headers[b'content-type'],
                b'text/xml; charset=utf-8')
            self.assertEqual(
                self.factories[0].headers[b'content-length'], b'129')

        def check_client_headers(ign):
            self.assertEqual(
                self.factories[0].sent_headers[b'user-agent'],
                b'Twisted/XMLRPClib')
            self.assertEqual(
                self.factories[0].sent_headers[b'content-type'],
                b'text/xml; charset=utf-8')
            self.assertEqual(
                self.factories[0].sent_headers[b'content-length'], b'155')

        d.addCallback(check_server_headers)
        d.addCallback(check_client_headers)
        return d

        Verify that headers sent from the client side and the ones we
        get back from the server side are correct.

        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_xmlrpc.py