Exemple #1
0
 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())
Exemple #2
0
 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())
Exemple #3
0
 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())
Exemple #4
0
 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())
Exemple #5
0
 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)
Exemple #6
0
 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)