def test_undefined_destexpr_var(self):
        try:
            self.top.connect('oneout.ratio1', 'oneinp.fake')
        except __HOLE__ as err:
            expected = ": "\
                       "Can't connect 'oneout.ratio1' to 'oneinp.fake': : "\
                       "'oneinp' has no variable 'fake'"

            self.assertEqual(str(err), expected)

        try:
            self.top.connect('oneout.ratio1', 'fake')
        except AttributeError as err:
            expected = ": "\
                       "Can't connect 'oneout.ratio1' to 'fake': : "\
                       "top level assembly has no variable 'fake'"

            self.assertEqual(str(err), expected)

        try:
            self.top.add('a', Assembly())
            self.top.a.add('oneout', Oneout())
            self.top.a.connect('oneout.ratio1', 'fake')
        except AttributeError as err:
            expected = "a: "\
                       "Can't connect 'oneout.ratio1' to 'fake': : "\
                       "'a' has no variable 'fake'"

            self.assertEqual(str(err), expected)
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.main/src/openmdao/main/test/test_connect_var.py/VariableTestCase.test_undefined_destexpr_var