'Test if invalid headers result in connectionLost events.'

def test_invalidHeaderDisconnects(self):

    factory = HAProxyWrappingFactory(Factory.forProtocol(StaticProtocol))
    proto = factory.buildProtocol(address.IPv4Address('TCP', '127.1.1.1', 8080))
    transport = StringTransportWithDisconnection()
    transport.protocol = proto
    proto.makeConnection(transport)
    proto.dataReceived('NOTPROXY    anything    can    go    here\r\n')
    self.assertFalse(transport.connected)
