示例#1
0
def test_interpolation_multiline():
    s = PlywoodString(0, '''
    testing {{
        if self.vars:
            self.vars
        }} is fun
''')
    assert_strings(s.python_value(Scope({'self': {'vars': 'da_vars'}})), '''
    testing da_vars is fun
''')
示例#2
0
def test_interpolation_multiline():
    s = PlywoodString(
        0, '''
    testing {{
        if self.vars:
            self.vars
        }} is fun
''')
    assert_strings(s.python_value(Scope({'self': {
        'vars': 'da_vars'
    }})), '''
    testing da_vars is fun
''')
示例#3
0
def test_interpolation_1():
    s = PlywoodString(0, 'testing {{"strings"}}')
    assert_strings(s.python_value(Scope()), 'testing strings')
示例#4
0
def test_interpolation_2():
    s = PlywoodString(0, 'testing {{self.vars}}')
    assert_strings(s.python_value(Scope({'self': {'vars': 'da_vars'}})), 'testing da_vars')
示例#5
0
def test_interpolation_1():
    s = PlywoodString(0, 'testing {{"strings"}}')
    assert_strings(s.python_value(Scope()), 'testing strings')
示例#6
0
def test_interpolation_2():
    s = PlywoodString(0, 'testing {{self.vars}}')
    assert_strings(s.python_value(Scope({'self': {
        'vars': 'da_vars'
    }})), 'testing da_vars')