Exemplo n.º 1
0
 def test_execnet_handler(self):
     def run_on_remote(channel):
         import logbook
         from logbook.queues import ExecnetChannelHandler
         handler = ExecnetChannelHandler(channel)
         log = logbook.Logger("Execnet")
         with handler:
             log.info('Execnet works')
     
     import execnet
     gw = execnet.makegateway()
     channel = gw.remote_exec(run_on_remote)
     from logbook.queues import ExecnetChannelSubscriber
     subscriber = ExecnetChannelSubscriber(channel)
     record = subscriber.recv()
     self.assertEqual(record.msg, 'Execnet works')
Exemplo n.º 2
0
def test_execnet_handler():
    def run_on_remote(channel):
        import logbook
        from logbook.queues import ExecnetChannelHandler
        handler = ExecnetChannelHandler(channel)
        log = logbook.Logger('Execnet')
        handler.push_application()
        log.info('Execnet works')

    import execnet
    gw = execnet.makegateway()
    channel = gw.remote_exec(run_on_remote)
    from logbook.queues import ExecnetChannelSubscriber
    subscriber = ExecnetChannelSubscriber(channel)
    record = subscriber.recv()
    assert record.msg == 'Execnet works'
    gw.exit()
Exemplo n.º 3
0
def test_execnet_handler():
    def run_on_remote(channel):
        import logbook
        from logbook.queues import ExecnetChannelHandler
        handler = ExecnetChannelHandler(channel)
        log = logbook.Logger('Execnet')
        handler.push_application()
        log.info('Execnet works')

    import execnet
    gw = execnet.makegateway()
    channel = gw.remote_exec(run_on_remote)
    from logbook.queues import ExecnetChannelSubscriber
    subscriber = ExecnetChannelSubscriber(channel)
    record = subscriber.recv()
    assert record.msg == 'Execnet works'
    gw.exit()