-
import unittest
from fractions import Fraction
def test_values(self):
self.assertCountEqual(self.expr.values(), [1, -2, 3])
- def test_symbol(self):
- self.assertEqual(self.x.symbol, 'x')
- with self.assertRaises(ValueError):
- self.pi.symbol
- with self.assertRaises(ValueError):
- self.expr.symbol
-
def test_issymbol(self):
self.assertTrue(self.x.issymbol())
self.assertFalse(self.pi.issymbol())
self.x = Symbol('x')
self.y = Symbol('y')
+ def test_name(self):
+ self.assertEqual(self.x.name, 'x')
+
def test_symbols(self):
self.assertListEqual(list(symbols('x y')), [self.x, self.y])
self.assertListEqual(list(symbols('x,y')), [self.x, self.y])