Exemplo n.º 1
0
 def test_catch_long_expression_chain(self):
     source = parse(
         "x = 3 * 1",
         "y = x - 5",
         "z = y + 2",
     )
     z = source.body[2]
     t = value_expr(z)
     assert t == "3 * 1 - 5 + 2"
Exemplo n.º 2
0
 def test_catch_expression_chain_with_functions(self):
     source = parse(
         "x = 3 * 1",
         "y = foo(x)",
         "z = y + 2",
     )
     z = source.body[2]
     t = value_expr(z)
     assert t == "foo(3 * 1) + 2"