- self.zero = Constant(0)
- self.one = Constant(1)
- self.pi = Constant(Fraction(22, 7))
+ self.x = Symbol('x')
+ self.y = Symbol('y')
+
+ def test(self):
+ self.assertTupleEqual(symbols('x y'), (self.x, self.y))
+ self.assertTupleEqual(symbols('x,y'), (self.x, self.y))
+ self.assertTupleEqual(symbols(['x', 'y']), (self.x, self.y))
+ with self.assertRaises(TypeError):
+ symbols(1)
+ with self.assertRaises(TypeError):
+ symbols(['a', 1])
+
+
+class TestRational(unittest.TestCase):
+
+ def setUp(self):
+ self.zero = Rational(0)
+ self.one = Rational(1)
+ self.pi = Rational(22, 7)