Exemple #1
0
 def set_controller(self, controller=None):
     ExtBackend.set_controller(self, controller)
     if controller:
         #controller.proc_cmd(self, command.ping("Are you there?"))
         controller.proc_cmd(self, command.no_output())
         controller.proc_cmd(self, self.cmd)
         self.wait = True
Exemple #2
0
 def set_controller(self, controller=None):
     ExtBackend.set_controller(self, controller)
     if controller:
         #controller.proc_cmd(self, command.ping("Are you there?"))
         controller.proc_cmd(self, command.no_output())
         controller.proc_cmd(self, self.cmd)
         self.wait = True
Exemple #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'))
Exemple #4
0
 def set_controller(self, controller=None):
     ExtBackend.set_controller(self, controller)
     if controller:
         self.__status = self._CONNECTED
         # FIXME: implement proper output filterring instead of no_output:
         controller.proc_cmd(self, command.no_output())
         for cid in self.__queue:
             cmd, d = self.__pending[cid]
             controller.proc_cmd(self, cmd)
             reactor.callLater(self.TIMEOUT, self.timeout, cid)
     else:
         self.__status = self._IDLE
Exemple #5
0
 def set_controller(self, controller=None):
     ExtBackend.set_controller(self, controller)
     if controller:
         self.__status = self._CONNECTED
         # FIXME: implement proper output filterring instead of no_output:
         controller.proc_cmd(self, command.no_output())
         for cid in self.__queue:
             cmd, d = self.__pending[cid]
             controller.proc_cmd(self, cmd)
             reactor.callLater(self.TIMEOUT, self.timeout, cid)
     else:
         self.__status = self._IDLE
Exemple #6
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'))
Exemple #7
0
 def set_controller(self, controller=None):
     CmdBackend.set_controller(self, controller)
     if controller:
         self.controller.proc_cmd(self, command.no_output())
Exemple #8
0
 def set_controller(self, controller=None):
     CmdBackend.set_controller(self, controller)
     if controller:
         self.controller.proc_cmd(self, command.no_output())