twisted.internet.base.BasePort - python examples

Here are the examples of the python api twisted.internet.base.BasePort taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

3 View Complete Implementation : test_unix.py
Copyright MIT License
Author : wistbean
    def test_listenFailure(self):
        """
        L{IReactorUNIX.listenUNIX} raises L{CannotListenError} if the
        underlying port's createInternetSocket raises a socket error.
        """
        def raiseSocketError(self):
            raise error('FakeBasePort forced socket.error')

        self.patch(base.BasePort, "createInternetSocket", raiseSocketError)
        reactor = self.buildReactor()
        with self.astertRaises(CannotListenError):
            reactor.listenUNIX('not-used', ServerFactory())