'L{IReactorUNIX.listenUNIX} raises L{CannotListenError} if the
underlying port\'s createInternetSocket raises a socket error.'

def test_listenFailure(self):

    def raiseSocketError(self):
        raise error('FakeBasePort    forced    socket.error')
    self.patch(base.BasePort, 'createInternetSocket', raiseSocketError)
    reactor = self.buildReactor()
    with self.assertRaises(CannotListenError):
        reactor.listenUNIX('not-used', ServerFactory())
