コード例 #1
0
    def test_load_file_as_dict(self):
        data = {"hello": "world"}

        expected_result = data

        file_path = get_named_tmpfile_path()

        with open(file_path, "w") as f:
            f.write(transform.dict_as_json(data))

        result = fs.load_file_as_dict(file_path)

        self.assertDictEqual(result, expected_result)
コード例 #2
0
ファイル: commit.py プロジェクト: beesperester/python-snapfs
def load_from_blob(path: Path) -> Commit:
    data = fs.load_file_as_dict(path)

    return deserialize_from_dict(data)
コード例 #3
0
ファイル: tag.py プロジェクト: beesperester/python-snapfs
def load_from_file(path: Path) -> Tag:
    return deserialize_from_dict(fs.load_file_as_dict(path))
コード例 #4
0
def load_from_file(path: Path) -> Differences:
    return deserialize_from_dict(fs.load_file_as_dict(path))