Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(19)  |  Call(19)  |  Derive(0)  |  Import(0)
Adds a dependency to be executed before this action.
Order of insertion of dependencies is not important.

:param ``Action`` dependency:

src/a/c/ActionTree-0.4.0/ActionTree/tests/Preview.py   ActionTree(Download)
    def testGetDependenciesAndLabelsAreNotOnlyEqualButSame(self):
        bLabel = ("b",)
        a = Action(lambda: 0, "a")
        b = Action(lambda: 0, bLabel)
        a.addDependency(b)
        c = Action(lambda: 0, "c")
        d = Action(lambda: 0, "d")
        a.addDependency(b)
        b.addDependency(c)
        c.addDependency(d)
        c = Action(lambda: 0, "label")
        d = Action(lambda: 0, "label")
        a.addDependency(b)
        b.addDependency(c)
        c.addDependency(d)

src/a/c/ActionTree-0.4.0/ActionTree/tests/DependencyCycle.py   ActionTree(Download)
    def testSelfDependency(self):
        a = Action(lambda: 0, "a")
        with self.assertRaises(Exception) as cm:
            a.addDependency(a)
        self.assertEqual(cm.exception.args[0], "Dependency cycle")
 
    def testShortCycle(self):
        a = Action(lambda: 0, "a")
        b = Action(lambda: 0, "b")
        a.addDependency(b)
        a.addDependency(b)
        with self.assertRaises(Exception) as cm:
            b.addDependency(a)
        self.assertEqual(cm.exception.args[0], "Dependency cycle")
 
        d = Action(lambda: 0, "d")
        e = Action(lambda: 0, "e")
        a.addDependency(b)
        b.addDependency(c)
        c.addDependency(d)