コード例 #1
0
ファイル: test_path_utils.py プロジェクト: AlexSnet/gitfs
    def test_split_path_into_components(self):
        empty_path = ''
        empty_path2 = '/'
        path = '/a/b'

        assert split_path_into_components(empty_path) == []
        assert split_path_into_components(empty_path2) == []
        assert split_path_into_components(path) == ['a', 'b']
コード例 #2
0
    def test_split_path_into_components(self):
        empty_path = ''
        empty_path2 = '/'
        path = '/a/b'

        assert split_path_into_components(empty_path) == []
        assert split_path_into_components(empty_path2) == []
        assert split_path_into_components(path) == ['a', 'b']
コード例 #3
0
ファイル: test_path_utils.py プロジェクト: tuxxon/gitfs
    def test_split_path_into_components(self):
        empty_path = ""
        empty_path2 = "/"
        path = "/a/b"

        assert split_path_into_components(empty_path) == []
        assert split_path_into_components(empty_path2) == []
        assert split_path_into_components(path) == ["a", "b"]
コード例 #4
0
    def access(self, path, mode):
        if hasattr(self, "relative_path") and self.relative_path != "/":
            path_elems = split_path_into_components(self.relative_path)
            is_valid_path = self._validate_commit_path(self.commit.tree,
                                                       path_elems)
            if not is_valid_path:
                raise FuseOSError(ENOENT)

        return 0
コード例 #5
0
ファイル: commit.py プロジェクト: AlexSnet/gitfs
    def access(self, path, mode):
        if hasattr(self, "relative_path") and self.relative_path != '/':
            path_elems = split_path_into_components(self.relative_path)
            is_valid_path = self._validate_commit_path(self.commit.tree,
                                                       path_elems)
            if not is_valid_path:
                raise FuseOSError(ENOENT)

        return 0