def test_fix_ansi_color_escapes(): cfg = ConfigParser() cfg.add_section('test') cfg.set('test', 'test', '\\001\\033[32m\\002test\\x01\\x1b[0m\\x02') _config_fixup(cfg) assert cfg.get('test', 'test') == '\001\033[32m\002test\001\033[0m\002'
def test_expand_vars(): cfg = ConfigParser() cfg.add_section('test') cfg.set('test', 'test', '~:$HOME') _config_fixup(cfg) assert cfg.get('test', 'test') == os.path.expanduser(os.path.expandvars('~:$HOME'))