'Test the sum_largest atom and related atoms.'

def test_sum_largest(self):

    with self.assertRaises(Exception) as cm:
        sum_largest(self.x, (-1))
    self.assertEqual(str(cm.exception), 'Second    argument    must    be    a    positive    integer.')
    with self.assertRaises(Exception) as cm:
        lambda_sum_largest(self.x, 2.4)
    self.assertEqual(str(cm.exception), 'First    argument    must    be    a    square    matrix.')
    with self.assertRaises(Exception) as cm:
        lambda_sum_largest(Variable(2, 2), 2.4)
    self.assertEqual(str(cm.exception), 'Second    argument    must    be    a    positive    integer.')
    atom = sum_largest(self.x, 2)
    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())
    copy = atom.copy(args=[self.y])
    self.assertTrue((type(copy) is type(atom)))
    self.assertTrue((copy.args[0] is self.y))
    self.assertEqual(copy.get_data(), atom.get_data())
    atom = lambda_sum_largest(Variable(2, 2), 2)
    copy = atom.copy()
    self.assertTrue((type(copy) is type(atom)))
