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

            self.assertEqual(str(err), expected)

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

            self.assertEqual(str(err), expected)

        try:
            self.top.connect('fake', 'oneinp.ratio1')
        except __HOLE__ as err:
            expected = ": "\
                       "Can't connect 'fake' to 'oneinp.ratio1': : "\
                       "top level assembly 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_srcexpr_var