def test_get_configparser(self, tmpdir): # we can parse simple configs conf_path = tmpdir / "sample.ini" conf_path.write("\n".join(["[diceware]", "num=1", ""])) found, config = get_configparser([ str(conf_path), ]) assert found == [str(conf_path)]
def test_get_configparser_default_path(self, home_dir): # a config file in $HOME is looked up by default config_file = home_dir / ".diceware.ini" config_file.write("\n".join(["[diceware]", "num = 3", ""])) found, config = get_configparser() assert found == [str(config_file)]
def test_get_configparser_no_list(self, home_dir): # we cope with no list at all found, config = get_configparser() assert found == []
def test_get_configparser_empty_list(self): # we cope with empty config file lists found, config = get_configparser([]) assert found == []
def test_get_configparser(self, tmpdir): # we can parse simple configs conf_path = tmpdir / "sample.ini" conf_path.write("\n".join(["[diceware]", "num=1", ""])) found, config = get_configparser([str(conf_path), ]) assert found == [str(conf_path)]