def load_cfg(cfg_filename): """ :type cfg_filename: str """ if is_ini(cfg_filename): return convert_ini(cfg_filename) else: return yaml.load(read_resource(cfg_filename), Loader=yaml.FullLoader)
def test_conflict_opts(ini_file, msgs): with pytest.raises(OptionsConflict) as e: convert_ini(os.path.join(os.path.dirname(__file__), ini_file)) assert all([msg in e.value.message for msg in msgs])
def test_conflict_opts(ini_file, msgs): with pytest.raises(OptionsConflict) as e: convert_ini(os.path.join(os.path.dirname(__file__), ini_file)) assert all([msg in e.value.message for msg in msgs])
def test_convert_ini_phantom(ini_file, yaml_file): with open(os.path.join(os.path.dirname(__file__), yaml_file), 'r') as f: assert convert_ini(os.path.join(os.path.dirname(__file__), ini_file)) == yaml.load( f, Loader=yaml.FullLoader)
def test_convert_ini_phantom(ini_file, yaml_file): with open(os.path.join(os.path.dirname(__file__), yaml_file), 'r') as f: assert convert_ini(os.path.join(os.path.dirname(__file__), ini_file)) == yaml.load(f)