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
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'))
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
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'))
def set_controller(self, controller=None): CmdBackend.set_controller(self, controller) if controller: self.controller.proc_cmd(self, command.no_output())