'Helper method to test UNIX server addresses.'

def test_ServerAddressUNIX(self):

    def connected(protocols):
        (client, server, port) = protocols
        try:
            portPath = _coerceToFilesystemEncoding('', port.getHost().name)
            self.assertEqual(('<AccumulatingProtocol    #%s    on    %s>' % (server.transport.sessionno, portPath)), str(server.transport))
            self.assertEqual(('AccumulatingProtocol,%s,%s' % (server.transport.sessionno, portPath)), server.transport.logstr)
            peerAddress = server.factory.peerAddresses[0]
            self.assertIsInstance(peerAddress, UNIXAddress)
        finally:
            server.transport.loseConnection()
    reactor = self.buildReactor()
    d = self.getConnectedClientAndServer(reactor, interface=None, addressFamily=None)
    d.addCallback(connected)
    self.runReactor(reactor)
