Пример #1
0
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
Пример #2
0
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
Пример #3
0
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
Пример #4
0
    @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
Пример #5
0
    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