def test_write_and_read_json(self): tempDirectory = tempfile.TemporaryDirectory().name os.makedirs(tempDirectory) Config.writeConfig([{"one": 10-9,"two": 5-3},{"three": 1+1+1,"four": 2*2}], os.path.join(tempDirectory, "test.yaml")) data = Config.loadConfig(os.path.join(tempDirectory, "test.yaml")) self.assertEqual(data, [{'two': 2, 'one': 1}, {'four': 4, 'three': 3}])
def test_write_and_read_yaml(self): tempDirectory = tempfile.TemporaryDirectory().name os.makedirs(tempDirectory) Config.writeConfig([{ "one": 10 - 9, "two": 5 - 3 }, { "three": 1 + 1 + 1, "four": 2 * 2 }], os.path.join(tempDirectory, "test.yaml")) data = Config.loadConfig(os.path.join(tempDirectory, "test.yaml")) self.assertEqual(data, [{'two': 2, 'one': 1}, {'four': 4, 'three': 3}])
def getParsedObject(self): return Config.loadConfig(self.getPath())
def getParsedObject(self): return Config.loadConfig(self.getPath())