X-Git-Url: https://scm.cri.mines-paristech.fr/git/linpy.git/blobdiff_plain/7afcb0a1ded9e9a331b131689d68c085f712143f..416e6bd198cde7d0c3506c79e3cbe5c2a44f48b8:/linpy/tests/test_linexprs.py?ds=sidebyside diff --git a/linpy/tests/test_linexprs.py b/linpy/tests/test_linexprs.py index fb7e4a2..1b01186 100644 --- a/linpy/tests/test_linexprs.py +++ b/linpy/tests/test_linexprs.py @@ -195,7 +195,7 @@ class TestLinExpr(unittest.TestCase): self.assertEqual(LinExpr.fromsympy(sp_x), self.x) self.assertEqual(LinExpr.fromsympy(sympy.Rational(22, 7)), self.pi) self.assertEqual(LinExpr.fromsympy(sp_x - 2*sp_y + 3), self.expr) - with self.assertRaises(ValueError): + with self.assertRaises(TypeError): LinExpr.fromsympy(sp_x*sp_y) @requires_sympy @@ -214,11 +214,20 @@ class TestSymbol(unittest.TestCase): self.y = Symbol('y') def test_new(self): - self.assertEqual(Symbol(' x '), self.x) + self.assertEqual(Symbol('x'), self.x) with self.assertRaises(TypeError): Symbol(self.x) with self.assertRaises(TypeError): Symbol(1) + with self.assertRaises(SyntaxError): + Symbol('1') + with self.assertRaises(SyntaxError): + Symbol('x.1') + with self.assertRaises(SyntaxError): + Symbol('x 1') + Symbol('_') + Symbol('_x') + Symbol('x_1') def test_name(self): self.assertEqual(self.x.name, 'x')