def test_schedule_remove_node(self): node1 = MockNode() sched = EachScheduling(1) sched.addnode(node1) collection = ["a.py::test_1", ] assert not sched.collection_is_completed sched.addnode_collection(node1, collection) assert sched.collection_is_completed assert sched.node2collection[node1] == collection sched.init_distribute() assert sched.tests_finished() crashitem = sched.remove_node(node1) assert crashitem assert sched.tests_finished() assert not sched.hasnodes()
def test_schedule_load_simple(self): node1 = MockNode() node2 = MockNode() sched = EachScheduling(2) sched.addnode(node1) sched.addnode(node2) collection = ["a.py::test_1", ] assert not sched.collection_is_completed sched.addnode_collection(node1, collection) assert not sched.collection_is_completed sched.addnode_collection(node2, collection) assert sched.collection_is_completed assert sched.node2collection[node1] == collection assert sched.node2collection[node2] == collection sched.init_distribute() assert sched.tests_finished() assert node1.sent == ['ALL'] assert node2.sent == ['ALL'] sched.remove_item(node1, 0) assert sched.tests_finished() sched.remove_item(node2, 0) assert sched.tests_finished()