'Test the mul_elemwise atom.'

def test_mul_elemwise(self):

    self.assertEqual(mul_elemwise([1, (-1)], self.x).sign, s.UNKNOWN)
    self.assertEqual(mul_elemwise([1, (-1)], self.x).curvature, s.AFFINE)
    self.assertEqual(mul_elemwise([1, (-1)], self.x).size, (2, 1))
    pos_param = Parameter(2, sign='positive')
    neg_param = Parameter(2, sign='negative')
    self.assertEqual(mul_elemwise(pos_param, pos_param).sign, s.POSITIVE)
    self.assertEqual(mul_elemwise(pos_param, neg_param).sign, s.NEGATIVE)
    self.assertEqual(mul_elemwise(neg_param, neg_param).sign, s.POSITIVE)
    self.assertEqual(mul_elemwise(neg_param, square(self.x)).curvature, s.CONCAVE)
    self.assertEqual(mul_elemwise([1, (-1)], 1).size, (2, 1))
    self.assertEqual(mul_elemwise(1, self.C).size, self.C.size)
    with self.assertRaises(Exception) as cm:
        mul_elemwise(self.x, [1, (-1)])
    self.assertEqual(str(cm.exception), 'The    first    argument    to    mul_elemwise    must    be    constant.')
