def put_msg(self, msg): """ Adds a message to the queue. @param msg: message to enqueue @type msg: str @return: done statement with received message @rtype: state.done """ self._queue.put(msg) return state.done() # returns none in order to force delay
def test_not_next(self): self.assertFalse(state.is_next(state.done(None))) self.assertFalse(state.is_next(state.replace(None)))
def test_done(self): self.assertTrue(state.is_done(state.done(None)))
def cmd_say_hello(self, msg=None): return state.done("hello to you too")
def c_echo(self, t): return state.done("echo "+t)
def h_count(self, t): return state.done("%d" % len(t))
def c_nothing(self, t): return state.done()