예제 #1
0
파일: test_config.py 프로젝트: Phyks/BMC
 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())
예제 #2
0
파일: test_config.py 프로젝트: Phyks/BMC
 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())
예제 #3
0
파일: test_config.py 프로젝트: m000/BMC
 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())
예제 #4
0
파일: test_config.py 프로젝트: m000/BMC
 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())
예제 #5
0
파일: test_config.py 프로젝트: Phyks/BMC
 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)
예제 #6
0
파일: test_config.py 프로젝트: m000/BMC
 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)