Exemplo n.º 1
0
def test_replace():
    defaults = {'default_variable': 'default setting'}
    settings = Settings(defaults)
    settings.read_settings_block(
        trim("""
        $ variable = setting
        """))
    out = settings.replace(
        trim("""
        This is a $[variable], and a $[default_variable]!
        """))
    assert out == "This is a setting, and a default setting!"
Exemplo n.º 2
0
def test_counters():
    settings = Settings()
    out = settings.replace(trim("""
        $[a++], $[a++], $[a++]
        """))
    assert out == "1, 2, 3"