示例#1
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']
示例#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
    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