Exemplo n.º 1
0
    def test_will_return_child_if_present_when_given_resource_path(self):
        n0 = BuildDependencyNode(self.class0)
        n1 = BuildDependencyNode(self.class1)
        n0.add_child(n1)

        c = n0.get_own_child(n1.cls.resource_path)
        self.assertIs(c, n1)
Exemplo n.º 2
0
    def test_will_remove_child_when_child_of_root(self):
        n0 = BuildDependencyNode(self.class0)
        n1 = BuildDependencyNode(self.class1)
        n0.add_child(n1)
        n0.find_remove(n1)

        self.assertNotIn(n1, n0.children)
Exemplo n.º 3
0
    def test_will_return_child_if_present_when_given_gd_script_class(self):
        n0 = BuildDependencyNode(self.class0)
        n1 = BuildDependencyNode(self.class1)
        n0.add_child(n1)

        c = n0.get_own_child(n1.cls)
        self.assertIs(c, n1)
Exemplo n.º 4
0
    def test_will_remove_child(self):
        n0 = BuildDependencyNode(self.class0)
        n1 = BuildDependencyNode(self.class1)
        n0.add_child(n1)
        n0.remove_child(n1)

        self.assertNotIn(n1, n0.children)
Exemplo n.º 5
0
    def test_will_return_parent_when_child_when_given_type_id(self):
        n0 = BuildDependencyNode(self.class0)
        n1 = BuildDependencyNode(self.class1)
        n0.add_child(n1)

        p = n0.find_parent(n1.cls.type_id)

        self.assertIs(p, n0)
Exemplo n.º 6
0
    def test_will_return_None_when_root(self):
        n0 = BuildDependencyNode(self.class0)
        n1 = BuildDependencyNode(self.class1)
        n0.add_child(n1)

        p = n0.find_parent(n1)

        self.assertIs(p, n0)
Exemplo n.º 7
0
    def test_will_find_child_by_resource_path(self):
        n0 = BuildDependencyNode(self.class0)
        n1 = BuildDependencyNode(self.class1)
        n0.add_child(n1)

        self.assertIs(n0.find(n1.cls.resource_path), n1)
Exemplo n.º 8
0
    def test_will_find_child_by_type_id(self):
        n0 = BuildDependencyNode(self.class0)
        n1 = BuildDependencyNode(self.class1)
        n0.add_child(n1)

        self.assertIs(n0.find(n1.cls.type_id), n1)