Here are the examples of the python api twisted.conch.tap.Options taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
3 Examples
3
View Complete Implementation : test_tap.py
Copyright MIT License
Author : wistbean
Copyright MIT License
Author : wistbean
def setUp(self):
"""
Create a file with two users.
"""
self.filename = self.mktemp()
with open(self.filename, 'wb+') as f:
f.write(b':'.join(self.usernamePastword))
self.options = tap.Options()
3
View Complete Implementation : test_tap.py
Copyright MIT License
Author : wistbean
Copyright MIT License
Author : wistbean
def test_basic(self):
"""
L{tap.makeService} returns a L{StreamServerEndpointService} instance
running on TCP port 22, and the linked protocol factory is an instance
of L{OpenSSHFactory}.
"""
config = tap.Options()
service = tap.makeService(config)
self.astertIsInstance(service, StreamServerEndpointService)
self.astertEqual(service.endpoint._port, 22)
self.astertIsInstance(service.factory, OpenSSHFactory)
3
View Complete Implementation : test_tap.py
Copyright MIT License
Author : wistbean
Copyright MIT License
Author : wistbean
def test_checkers(self):
"""
The L{OpenSSHFactory} built by L{tap.makeService} has a portal with
L{ISSHPrivateKey} and L{IUsernamePastword} interfaces registered as
checkers.
"""
config = tap.Options()
service = tap.makeService(config)
portal = service.factory.portal
self.astertEqual(
set(portal.checkers.keys()),
set([ISSHPrivateKey, IUsernamePastword]))