コード例 #1
0
    def test_overrides(self):
        with tempfile.NamedTemporaryFile("w+") as conf:
            conf.file.write("group: {var1: val1}")
            conf.file.close()

            config.load_overrides(conf.name)
            g = config.get_group("group")
            self.assertEqual(g.var1, "val1")

        with self.assertRaises(FileNotFoundError):
            config.load_overrides("a_hopefully_nonexistent_file.ini")
コード例 #2
0
 def test_default_overrides(self):
     # no default ini to load
     config.load_overrides()
     self.assertEqual(len(config._groups), 0)