self.assertEqual(self.expr.subs('x', -3), -2 * self.y)
self.assertEqual(self.expr.subs([('x', self.y), ('y', self.x)]), 3 - self.x)
self.assertEqual(self.expr.subs({'x': self.y, 'y': self.x}), 3 - self.x)
- self.assertEqual(self.expr.subs({self.x: self.y, self.y: self.x}), 3 - self.x)
+ self.assertEqual(self.expr.subs({self.x: self.z, self.y: self.z}), -self.z + 3)
def test_fromstring(self):
self.assertEqual(Expression.fromstring('x'), self.x)