+ def test_repr(self):
+ self.assertEqual(repr(self.x), '_x')
+ dummy1 = Dummy()
+ dummy2 = Dummy()
+ self.assertTrue(repr(dummy1).startswith('_Dummy_'))
+ self.assertNotEqual(repr(dummy1), repr(dummy2))
+
+
+class TestSymbols(unittest.TestCase):
+
+ def setUp(self):
+ 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])
+