diff --git a/nc_py_api/files.py b/nc_py_api/files.py index c78ae447..255a4aa6 100644 --- a/nc_py_api/files.py +++ b/nc_py_api/files.py @@ -117,9 +117,9 @@ class FilesAPI: def __init__(self, session: NcSessionBasic): self._session = session - def listdir(self, path="", exclude_self=True, root=False) -> list[FsNode]: + def listdir(self, path="", exclude_self=True) -> list[FsNode]: properties = PROPFIND_PROPERTIES - return self._listdir("" if root else self._session.user, path, properties=properties, exclude_self=exclude_self) + return self._listdir(self._session.user, path, properties=properties, exclude_self=exclude_self) def by_id(self, fileid: int) -> Optional[FsNode]: result = self.find(req=["eq", "fileid", fileid]) diff --git a/tests/files_test.py b/tests/files_test.py index c2237adb..1b61c7a7 100644 --- a/tests/files_test.py +++ b/tests/files_test.py @@ -28,15 +28,6 @@ def write(self, *args, **kwargs): return super().write(*args, **kwargs) -@pytest.mark.parametrize("nc", NC_TO_TEST) -def test_list_root(nc): - files_root = nc.files.listdir(root=True) - assert files_root - for obj in files_root: - assert not obj.user - assert obj.full_path == obj.path - - @pytest.mark.parametrize("nc", NC_TO_TEST) def test_list_user_root(nc): user_root = nc.files.listdir() @@ -191,6 +182,7 @@ def test_file_delete(nc): @pytest.mark.parametrize("nc", NC_TO_TEST) @pytest.mark.parametrize("dir_name", ("1 2", "Яё", "відео та картинки", "复杂 目录 Í", "Björn", "João")) def test_mkdir(nc, dir_name): + nc.files.delete(dir_name, not_fail=True) nc.files.mkdir(dir_name) with pytest.raises(NextcloudException): nc.files.mkdir(dir_name)