예제 #1
0
파일: config.py 프로젝트: Andais/jasy
    def test_write_yaml(self):

        tempDirectory = tempfile.TemporaryDirectory().name
        os.makedirs(tempDirectory)

        Config.writeConfig([{"one": 1,"two": 2},{"three": 3,"four": 4}], os.path.join(tempDirectory, "test.yaml"))
        
        self.assertEqual(Config.findConfig(os.path.join(tempDirectory, "test.yaml")), os.path.join(tempDirectory, "test.yaml"))        
예제 #2
0
파일: config.py 프로젝트: Andais/jasy
    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}]) 
예제 #3
0
파일: config.py 프로젝트: isabella232/jasy
    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}])
예제 #4
0
파일: config.py 프로젝트: isabella232/jasy
    def test_write_yaml(self):

        tempDirectory = tempfile.TemporaryDirectory().name
        os.makedirs(tempDirectory)

        Config.writeConfig([{
            "one": 1,
            "two": 2
        }, {
            "three": 3,
            "four": 4
        }], os.path.join(tempDirectory, "test.yaml"))

        self.assertEqual(
            Config.findConfig(os.path.join(tempDirectory, "test.yaml")),
            os.path.join(tempDirectory, "test.yaml"))