Ejemplo n.º 1
0
    def test_group_getsystem_middle(self):
        from openmdao.api import Problem
        from openmdao.core.tests.test_group import BranchGroup

        p = Problem(model=BranchGroup())
        p.setup()

        grp = p.model.get_subsystem('Branch1.G1')
        c1 = grp.get_subsystem('G2.comp1')
        self.assertEqual(c1.pathname, 'Branch1.G1.G2.comp1')
Ejemplo n.º 2
0
    def test_group_getsystem_top(self):
        from openmdao.api import Problem
        from openmdao.core.tests.test_group import BranchGroup

        p = Problem(model=BranchGroup())
        p.setup()

        c1 = p.model.Branch1.G1.G2.comp1
        self.assertEqual(c1.pathname, 'Branch1.G1.G2.comp1')

        c2 = p.model.Branch2.G3.comp2
        self.assertEqual(c2.pathname, 'Branch2.G3.comp2')