示例#1
0
def test_no_more_tasks():
    a_mixin = AsyncTestMixin()
    a_mixin.sub_setUp()
    a_mixin.assertNumCrosstownTasks(0)

    def some_task():
        pass

    through_to_you = crosstown_traffic()
    through_to_you(some_task)

    same_task = a_mixin.next_task()

    # That will be the only (and thus last) task.
    with pytest.raises(StopIteration):
        a_mixin.next_task()
示例#2
0
def test_next_task():
    a_mixin = AsyncTestMixin()
    a_mixin.sub_setUp()
    a_mixin.assertNumCrosstownTasks(0)

    def some_task():
        pass

    through_to_you = crosstown_traffic()
    through_to_you(some_task)

    assert some_task is a_mixin.next_task()