'Test the sum_entries atom.'

def test_sum_entries(self):

    self.assertEqual(sum_entries(1).sign, s.POSITIVE)
    self.assertEqual(sum_entries([1, (-1)]).sign, s.UNKNOWN)
    self.assertEqual(sum_entries([1, (-1)]).curvature, s.CONSTANT)
    self.assertEqual(sum_entries(Variable(2)).sign, s.UNKNOWN)
    self.assertEqual(sum_entries(Variable(2)).size, (1, 1))
    self.assertEqual(sum_entries(Variable(2)).curvature, s.AFFINE)
    mat = np.mat('1    -1')
    self.assertEqual(sum_entries((mat * square(Variable(2)))).curvature, s.UNKNOWN)
    self.assertEqual(sum_entries(Variable(2), axis=0).size, (1, 1))
    self.assertEqual(sum_entries(Variable(2), axis=1).size, (2, 1))
    self.assertEqual(sum_entries(Variable(2, 3), axis=0).size, (1, 3))
    self.assertEqual(sum_entries(Variable(2, 3), axis=1).size, (2, 1))
    with self.assertRaises(Exception) as cm:
        sum_entries(self.x, axis=4)
    self.assertEqual(str(cm.exception), 'Invalid    argument    for    axis.')
