def test_src_idx_neg(self):
        class A(Component):
            def __init__(self):
                super(A, self).__init__()
                self.add_output('y', np.zeros((5,)), shape=(5,))

        class B(Component):
            def __init__(self):
                super(B, self).__init__()
                self.add_param('x', np.zeros((3,)), shape=(3,))

        # src_indices larger than src
        prob = Problem(root=Group())
        prob.root.add("A", A())
        prob.root.add("B", B())
        prob.root.connect("A.y", "B.x", src_indices=[0, 1, -1])
        try:
            prob.setup(check=False)
        except Exception as err:
            self.assertTrue("'B.x' src_indices contains a negative index (-1)." in str(err))
        else:
            self.fail("Exception expected")
dataset/ETHPy150Open OpenMDAO/OpenMDAO/openmdao/core/test/test_problem.py/TestProblem.test_src_idx_neg/original