def test_invalidHeaderDisconnects(self):
        """
        Test if invalid headers result in connectionLost events.
        """
        factory = HAProxyWrappingFactory(Factory.forProtocol(StaticProtocol))
        proto = factory.buildProtocol(
            address.IPv6Address('TCP', b'::1', 8080),
        )
        transport = StringTransportWithDisconnection()
        transport.protocol = proto
        proto.makeConnection(transport)
        proto.dataReceived(b'\x00' + self.IPV4HEADER[1:])
        self.assertFalse(transport.connected)

        Test if invalid headers result in connectionLost events.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/protocols/haproxy/test/test_wrapper.py