def setUp(self):
    super(TestTelnet, self).setUp()
    factory = TelnetServerFactory()
    factory.protocol = TelnetProtocol
    factory.sessionhandler = PORTAL_SESSIONS
    factory.sessionhandler.portal = Mock()
    self.proto = factory.buildProtocol(('localhost', 0))
    self.transport = proto_helpers.StringTransport()
    self.addCleanup(factory.sessionhandler.disconnect_all)
def setUp(self):
    super(TestTelnet, self).setUp()
    factory = TelnetServerFactory()
    factory.protocol = TelnetProtocol
    factory.sessionhandler = PORTAL_SESSIONS
    factory.sessionhandler.portal = Mock()
    self.proto = factory.buildProtocol(('localhost', 0))
    self.transport = proto_helpers.StringTransport()
    self.addCleanup(factory.sessionhandler.disconnect_all)