def test_loop_function_call(): a = A() b = B() con = LoopContainer() a.spawn(b) a.start(con) b.fail() wait = queue.Queue() con.spawn(wait) try: container, result = wait.get() raise result except Done: pass assert True
def test_loop_function_call(): obj = OOO() con = LoopContainer() obj.start(con) obj.tryit(1337) obj.acall("tryit", 1337) obj.tryit(1337) obj.finish() wait = queue.Queue() con.spawn(wait) try: container, result = wait.get() raise result except Done: pass assert True
@amethod def finish(self): raise Done class B(Supervised): @amethod def fail(self): raise Exception("blbost") if __name__ == "__main__": a = A() b = B() con = LoopContainer() a.spawn(b) a.start(con) b.fail() a.finish() wait = queue.Queue() con.spawn(wait) try: container, result = wait.get() raise result except Done: pass
def finish(self): raise Done class B(Supervised): @amethod def fail(self): raise Exception("blbost") if __name__ == "__main__": a = A() b = B() con = LoopContainer() a.spawn(b) a.start(con) b.fail() a.finish() wait = queue.Queue() con.spawn(wait) try: container, result = wait.get() raise result except Done: pass