예제 #1
0
 def coro():
     yield command.ping('Are you there?')
     yield command.PING('Hello World!')
     yield command.Command('dump')
     yield command.run('/usr/bin/bash', args=['-c','echo $ZZ1; echo $ZZ2'], env=dict(ZZ1='Zzzz...', ZZ2='__ZZZZ__'))
     yield 'end' # start monitoring 'end'
     yield command.Command('dump')
     yield WAIT
     yield command.Command('dump')
     return
예제 #2
0
    def testMain(self):

        be = backends.CmdOnlyBackend()
        be.set_controller(FakeController(test_case=self, expected=command.no_output()))

        def test(be, input, output):
            be.controller.expected = output
            be.proc_input(input)

        test(be, 'ping', command.ping())
        test(be, 'PING a message', command.PING('a message'))
        test(be, 'run a_task', command.run('a_task'))
예제 #3
0
    def testMain(self):

        be = backends.CmdOnlyBackend()
        be.set_controller(
            FakeController(test_case=self, expected=command.no_output()))

        def test(be, input, output):
            be.controller.expected = output
            be.proc_input(input)

        test(be, 'ping', command.ping())
        test(be, 'PING a message', command.PING('a message'))
        test(be, 'run a_task', command.run('a_task'))
예제 #4
0
파일: twbackend.py 프로젝트: sssst315/beah
 def set_controller(self, controller=None):
     PprintBackend.set_controller(self, controller)
     if controller:
         self.controller.proc_cmd(self, command.ping("Are you there?"))
예제 #5
0
 def testCommands(self):
     self._test_('ping', command.ping())
     self._test_('ping hello world', command.ping('hello world'))
     self._test_('PING', command.PING())
     self._test_('PING hello world', command.PING('hello world'))
     self._test_('kill', command.command('kill'))
예제 #6
0
 def proc_cmd_ping(self, cmd, cmd_args):
     if cmd_args:
         message = ' '.join(cmd_args)
     else:
         message = None
     return command.ping(message)
예제 #7
0
 def testCommands(self):
     self._test_('ping', command.ping())
     self._test_('ping hello world', command.ping('hello world'))
     self._test_('PING', command.PING())
     self._test_('PING hello world', command.PING('hello world'))
     self._test_('kill', command.command('kill'))
예제 #8
0
 def proc_cmd_ping(self, cmd, cmd_args):
     if cmd_args:
         message = ' '.join(cmd_args)
     else:
         message = None
     return command.ping(message)