Exemplo n.º 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']
Exemplo n.º 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']
Exemplo n.º 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"]
Exemplo n.º 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
Exemplo n.º 5
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