Exemplo n.º 1
0
    def testIntegration(self):
        # CONFIG:
        config.beah_conf(args=[])
        conf = config.get_conf('beah')
        srv = start_server(conf=conf)
        log = logging.getLogger('backend')

        class FakeTask(object):
            origin = {'signature': 'FakeTask'}
            task_id = 'no-id'

            def proc_cmd(self, cmd):
                log.debug("FakeTask.proc_cmd(%r)", cmd)

        class FakeBackend(object):
            def proc_evt(self, evt, **kwargs):
                log.debug("FakeBackend.proc_evt(%r, **%r)", evt, kwargs)

        t = FakeTask()
        reactor.callLater(2, srv.proc_evt, t,
                          event.variable_set('say_hi', 'Hello World!'))
        #reactor.callLater(2.1, srv.proc_evt, t, event.variable_get('say_hi'))
        reactor.callLater(2.2, srv.proc_evt, t,
                          event.variable_get('say_hi', dest='test.loop'))

        b = FakeBackend()
        reactor.callLater(3, srv.proc_cmd, b, command.kill())

        forwarder.main(args=[])
Exemplo n.º 2
0
    def testIntegration(self):
        # CONFIG:
        config.beah_conf(args=[])
        conf = config.get_conf('beah')
        srv = start_server(conf=conf)
        log = logging.getLogger('backend')

        class FakeTask(object):
            origin = {'signature':'FakeTask'}
            task_id = 'no-id'
            def proc_cmd(self, cmd):
                log.debug("FakeTask.proc_cmd(%r)", cmd)

        class FakeBackend(object):
            def proc_evt(self, evt, **kwargs):
                log.debug("FakeBackend.proc_evt(%r, **%r)", evt, kwargs)

        t = FakeTask()
        reactor.callLater(2, srv.proc_evt, t, event.variable_set('say_hi', 'Hello World!'))
        #reactor.callLater(2.1, srv.proc_evt, t, event.variable_get('say_hi'))
        reactor.callLater(2.2, srv.proc_evt, t, event.variable_get('say_hi', dest='test.loop'))

        b = FakeBackend()
        reactor.callLater(3, srv.proc_cmd, b, command.kill())

        forwarder.main(args=[])
Exemplo n.º 3
0
 def proc_cmd_kill(self, cmd, cmd_args):
     return command.kill()
Exemplo n.º 4
0
 def proc_cmd_kill(self, cmd, cmd_args):
     return command.kill()