Пример #1
0
    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}]) 
Пример #2
0
    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}])
Пример #3
0
 def getParsedObject(self):
     return Config.loadConfig(self.getPath())
Пример #4
0
 def getParsedObject(self):
     return Config.loadConfig(self.getPath())