Пример #1
0
 def testCheckPath(self, procs, starts, proc, passed):
     for p in procs:
         ProcTree.register(p)
     pt = ProcTree()
     pt.setStarts(starts)
     if isinstance(passed, bool):
         self.assertEqual(pt.checkPath(proc), passed)
     else:
         self.assertListEqual(pt.checkPath(proc), passed)
Пример #2
0
def test_proctree_chechpath(set2):
    # p15 -> p16  ->  p17 -> 19
    # p14 _/  \_ p18_/  \_ p20
    #           hide
    pt = ProcTree()
    pt.init()
    assert pt.checkPath(set2.p16) == [set2.p14]
    pt.setStarts([set2.p14])
    assert pt.checkPath(set2.p16) == [set2.p15]
    pt.setStarts([set2.p14, set2.p15])
    assert pt.checkPath(set2.p16) is True