Пример #1
0
 def testReset(self, procs):
     for p in procs:
         ProcTree.register(p)
     ProcTree()
     ProcTree.reset()
     for node in ProcTree.NODES.values():
         self.assertListEqual(node.prev, [])
         self.assertListEqual(node.next, [])
         self.assertFalse(node.ran)
         self.assertFalse(node.start)
Пример #2
0
def test_proctree_getnext_and_reset():
    p10 = Proc()
    p11 = Proc()
    p11.depends = p10
    ProcTree.register(p10)
    ProcTree().init()
    assert ProcTree.getNext(p10) == [p11]
    assert ProcTree.getNext(p11) == []

    ProcTree.reset()
    ProcTree.NODES[p10].prev == []
    ProcTree.NODES[p10].next == []
    ProcTree.NODES[p11].prev == []
    ProcTree.NODES[p11].next == []
    ProcTree.NODES[p10].ran == False
    ProcTree.NODES[p10].start == False
    ProcTree.NODES[p11].ran == False
    ProcTree.NODES[p11].start == False