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!"
def test_counters(): settings = Settings() out = settings.replace(trim(""" $[a++], $[a++], $[a++] """)) assert out == "1, 2, 3"