Exemple #1
0
    def testStringDefaultInterpolation(self):
        c = Config(spec=Dict(a=String(default="letter a"),
                             aa=String(default="a {{a}}")))
        c.load_data({})
        c.resolve()

        self.assertEqual(c.get("aa"), "a letter a")
Exemple #2
0
def check_app(app):
    config_path = "apps/{}.yaml".format(app)
    cfg = Config(filepath=config_path, spec=spec_app).finalize()
    pprint(dir(cfg))
    pprint(cfg.data)
Exemple #3
0
    def testCircularDependency(self):
        c = Config(spec=Dict(a=String()))
        c.load_data({"a": "a{{a}}a"})

        with self.assertRaises(CircularDependency):
            c.resolve()