def test_ensure_defaults(): cfg = ConfigParser() _ensure_defaults(cfg) for section, options in _defaults.items(): assert cfg.has_section(section) for option in options.keys(): assert cfg.has_option(section, option) assert cfg.get(section, option) == options[option]
def test_load_config_env_var_empty(): os.environ['FOE_CONFIG'] = '' cfg = load_config() for section, options in _defaults.items(): assert cfg.has_section(section) for option in options.keys(): assert cfg.has_option(section, option) assert cfg.get(section, option) == os.path.expanduser(os.path.expandvars(options[option]))