'Test the copy function for index.'

def test_index(self):

    size = (5, 4)
    A = Variable(*size)
    atom = A[0:2, 0:1]
    copy = atom.copy()
    self.assertTrue((type(copy) is type(atom)))
    self.assertEqual(copy.args, atom.args)
    self.assertFalse((copy.args is atom.args))
    self.assertEqual(copy.get_data(), atom.get_data())
    B = Variable(4, 5)
    copy = atom.copy(args=[B])
    self.assertTrue((type(copy) is type(atom)))
    self.assertTrue((copy.args[0] is B))
    self.assertEqual(copy.get_data(), atom.get_data())
