Exemple #1
0
 def test_config_reader_bad(self):
     try:
         cfg = reusables.config_namespace(
             reusables.join_paths(test_root, "data", "test_bad_config.ini"))
     except AttributeError:
         pass
     else:
         assert False
Exemple #2
0
 def test_config_reader_bad(self):
     try:
         cfg = reusables.config_namespace(
             reusables.join_paths(test_root, "data", "test_bad_config.ini"))
     except AttributeError:
         pass
     else:
         assert False
Exemple #3
0
    def test_config_reader(self):
        cfg = reusables.config_namespace(
            reusables.join_paths(test_root, "data", "test_config.ini"))

        assert isinstance(cfg, reusables.ConfigNamespace)
        assert cfg.General.example == "A regular string"

        assert cfg["Section 2"].list(
            "exampleList", mod=lambda x: int(x)) == [234, 123, 234, 543]
Exemple #4
0
    def test_config_reader(self):
        cfg = reusables.config_namespace(
            reusables.join_paths(test_root, "data", "test_config.ini"))

        assert isinstance(cfg, reusables.ConfigNamespace)
        assert cfg.General.example == "A regular string"

        assert cfg["Section 2"].list(
            "exampleList", mod=lambda x: int(x)) == [234, 123, 234, 543]
Exemple #5
0
 def test_get_config_namespace(self):
     resp = reusables.config_namespace(
         os.path.join(test_root, 'test_config.cfg'))
     assert resp.Section1.key2 == 'Value2', str(resp.Section1)
Exemple #6
0
 def test_get_config_namespace(self):
     resp = reusables.config_namespace(os.path.join(test_root,
                                                'test_config.cfg'))
     assert resp.Section1.key2 == 'Value2', str(resp.Section1)