Ejemplo n.º 1
0
 def setUp(self):
     self.stream = StringIO()
     handler = Debugging(self.stream)
     controller = Controller(handler)
     controller.start()
     self.addCleanup(controller.stop)
     self.address = (controller.hostname, controller.port)
Ejemplo n.º 2
0
def debugging_controller(get_controller) -> Generator[Controller, None, None]:
    # Cannot use plain_controller fixture because we need to first create the
    # Debugging handler before creating the controller.
    stream = StringIO()
    handler = Debugging(stream)
    controller = get_controller(handler)
    controller.start()
    Global.set_addr_from(controller)
    #
    yield controller
    #
    controller.stop()
    stream.close()
Ejemplo n.º 3
0
 def __enter__(self) -> 'DummyMailServer':
     # skipcq: PYL-W0201
     self._controller = Controller(
         handler=Debugging(),
         tls_context=self._tsl_context,
         # otherwise mail-client have to decode data manually (split by \r\n)
         decode_data=True,
         # require starttls from client for authentication
         require_starttls=True,
         port=self._port,
         authenticator=self.authenticator)
     self._controller.start()
     return self
Ejemplo n.º 4
0
 def setUp(self):
     self.data = StringIO()
     self.controller = Controller(Debugging(self.data),
                                  hostname=self.config['local_host'],
                                  port=self.config['local_port'])
     self.controller.start()
Ejemplo n.º 5
0
async def amain(mainEventLoop):
    cont = Controller(Debugging(), hostname='0.0.0.0', port=myPort)
    cont.start()