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
3
View Complete Implementation : test_unix.py
Copyright MIT License
Author : wistbean
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())