Example #1
0
 def test_add(self):
     expr = Add(Variable("x"), Variable("y"))
     en = {"x": Number(1), "y": Number(2)}
     while expr.reducible:
         expr = expr.reduce(en)
     self.assertEqual(expr, Number(3))
Example #2
0
def test_add():
    expr = Add(Variable("x"), Variable("y"))
    en = {"x": Number(1), "y": Number(2)}
    while expr.reducible:
        expr = expr.reduce(en)
    assert expr == Number(3)
Example #3
0
 def test_add(self):
     expr = Add(Variable("x"), Variable("y"))
     en = {"x": Number(1), "y": Number(2)}
     while expr.reducible:
         expr = expr.reduce(en)
     self.assertEqual(expr, Number(3))