def test_010_config_manager(self): """ Test writing config out, using the internally-specified config file. """ with open(self.valid_file, 'r') as f: old_json = json.load(f) cfg = ConfigManager(self.valid_file) cfg.write() with open(self.valid_file, 'r') as f: new_json = json.load(f) self.assertEqual(old_json, new_json)
def test_009_config_manager(self): """ Test writing config to a specified output file. """ with open(self.valid_file, 'r') as f: old_json = json.load(f) cfg = ConfigManager(self.valid_file) cfg.write(self.valid_file) with open(self.valid_file, 'r') as f: new_json = json.load(f) self.assertEqual(old_json, new_json)
def test_011_config_manager(self): """ Test writing config out, with no output file specified. """ cfg = ConfigManager() with self.assertRaises(ValueError): cfg.write()