'Test if UNIX headers result in the correct host and peer data.'

def test_validUNIXHeaderResolves_getPeerHost(self):

    factory = HAProxyWrappingFactory(Factory.forProtocol(StaticProtocol))
    proto = factory.buildProtocol(address.UNIXAddress('/home/test/sockets/server.sock'))
    transport = StringTransportWithDisconnection()
    proto.makeConnection(transport)
    proto.dataReceived(self.UNIXHEADER)
    self.assertEqual(proto.getPeer().name, '/home/tests/mysockets/sock')
    self.assertEqual(proto.wrappedProtocol.transport.getPeer().name, '/home/tests/mysockets/sock')
    self.assertEqual(proto.getHost().name, '/home/tests/mysockets/sock')
    self.assertEqual(proto.wrappedProtocol.transport.getHost().name, '/home/tests/mysockets/sock')
