Exemplo n.º 1
0
def test_preprocessor_replace_expression_argument(magic, tree):
    parent = magic(expression=None)
    expression = magic()
    Preprocessor.replace_expression(tree, parent, expression)
    tree.add_assignment.assert_called_with(expression.service)
    assignment = tree.add_assignment().path.child()
    parent.entity.path.replace.assert_called_with(0, assignment)
Exemplo n.º 2
0
def test_preprocessor_replace_expression(magic, tree):
    parent = magic()
    expression = magic()
    Preprocessor.replace_expression(tree, parent, expression)
    tree.add_assignment.assert_called_with(expression.service)
    assignment = tree.add_assignment().path.child()
    entity = parent.expression.multiplication.exponential.factor.entity
    entity.path.replace.assert_called_with(0, assignment)
Exemplo n.º 3
0
def test_preprocessor_replace_expression(magic, tree):
    parent = magic()
    expression = magic()
    Preprocessor.replace_expression(tree, parent, expression)
    tree.add_assignment.assert_called_with(expression.service)
    parent.replace.assert_called_with(1, tree.add_assignment().path)