Beispiel #1
0
def test_unwrap_preserve():
    inner_expression = Expression()
    inner_expression.append(Unit(10))
    inner_expression.append(Unit(20))
    assert utils.unwrap(inner_expression) == inner_expression
    outer_expression = Expression()
    outer_expression.preserve = True
    outer_expression.append(inner_expression)
    assert utils.unwrap(outer_expression) == outer_expression
Beispiel #2
0
def test_expression_make_is_list_and_preserve():
    expression = Expression()
    expression.is_list = True
    expression.preserve = True
    assert expression.is_list
    assert expression.preserve