def test_buildProtocol(self):
        """
        L{ProxyClientFactory.buildProtocol} should produce a L{ProxyClient}
        with the same values of attributes (with updates on the headers).
        """
        factory = ProxyClientFactory(b'GET', b'/foo', b'HTTP/1.0',
                                     {b"accept": b"text/html"}, b'Some data',
                                     None)
        proto = factory.buildProtocol(None)
        self.assertIsInstance(proto, ProxyClient)
        self.assertEqual(proto.command, b'GET')
        self.assertEqual(proto.rest, b'/foo')
        self.assertEqual(proto.data, b'Some data')
        self.assertEqual(proto.headers,
                          {b"accept": b"text/html", b"connection": b"close"})

        L{ProxyClientFactory.buildProtocol} should produce a L{ProxyClient}
        with the same values of attributes (with updates on the headers).
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_proxy.py