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)
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)
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)