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

def test_headers(self):

    d = self.proxy().callRemote('snowman', u'\u2603')
    def check_server_headers(ing):
        self.assertEqual(self.factories[0].headers['content-type'], 'text/xml;    charset=utf-8')
        self.assertEqual(self.factories[0].headers['content-length'], '129')
    def check_client_headers(ign):
        self.assertEqual(self.factories[0].sent_headers['user-agent'], 'Twisted/XMLRPClib')
        self.assertEqual(self.factories[0].sent_headers['content-type'], 'text/xml;    charset=utf-8')
        self.assertEqual(self.factories[0].sent_headers['content-length'], '155')
    d.addCallback(check_server_headers)
    d.addCallback(check_client_headers)
    return d
