def test_load_conf_dict(self): conf = WhatTheFileConfiguration() conf.parse_dict(self.get_conf_dict()) self.assertEqual(len(conf.get_modules_names()), 10) self.assertTrue(conf.get_property_boolean("module.hashes", "active")) self.assertTrue("active" in conf.get_section("module.hashes"))
def test_load_modules(self): config = WhatTheFileConfiguration() config.parse_dict(self.get_config_dict()) modules = LoaderModules(config).get_modules() self.assertEqual(len(modules), len(config.get_modules_names()))
def test_load_conf_file(self): conf = WhatTheFileConfiguration() conf.parse_file('./tests/examples/whatthefile.ini') self.assertEqual(len(conf.get_modules_names()), 10) self.assertTrue(conf.get_property_boolean("module.hashes", "active")) self.assertTrue("active" in conf.get_section("module.hashes"))