def test_save(self): config = Config(base_config_path=self.folder) config.set("foo", "bar") config.save() with open(self.folder+"bmc.json", 'r') as fh: read = json.loads(fh.read()) self.assertEqual(read, config.as_dict())
def test_load_with_file(self): config = self.default_config config["foo"] = "bar" with open(self.folder+"bmc.json", 'w') as fh: json.dump(config, fh) config_read = Config(base_config_path=self.folder) self.assertEqual(config, config_read.as_dict())
def test_save(self): config = Config(base_config_path=self.folder) config.set("foo", "bar") config.save() with open(self.folder + "bmc.json", 'r') as fh: read = json.loads(fh.read()) self.assertEqual(read, config.as_dict())
def test_load_with_file(self): config = self.default_config config["foo"] = "bar" with open(self.folder + "bmc.json", 'w') as fh: json.dump(config, fh) config_read = Config(base_config_path=self.folder) self.assertEqual(config, config_read.as_dict())
def test_load_without_file(self): config = Config(base_config_path=self.folder) self.assertEqual(config.as_dict(), self.default_config) with open(self.folder+"bmc.json", 'r') as fh: read = json.loads(fh.read()) self.assertEqual(read, self.default_config)
def test_load_without_file(self): config = Config(base_config_path=self.folder) self.assertEqual(config.as_dict(), self.default_config) with open(self.folder + "bmc.json", 'r') as fh: read = json.loads(fh.read()) self.assertEqual(read, self.default_config)