예제 #1
0
 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)]
예제 #2
0
 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)]
예제 #3
0
 def test_get_configparser_no_list(self, home_dir):
     # we cope with no list at all
     found, config = get_configparser()
     assert found == []
예제 #4
0
 def test_get_configparser_empty_list(self):
     # we cope with empty config file lists
     found, config = get_configparser([])
     assert found == []
예제 #5
0
 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)]