Skip to content

Commit

Permalink
fix: fix missing tests with root dir
Browse files Browse the repository at this point in the history
  • Loading branch information
john-jam committed Aug 8, 2023
1 parent 45f828d commit 2f33e1b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions fsspec/implementations/tests/test_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -954,12 +954,12 @@ def test_cp_get_put_empty_directory(tmpdir, funcname):
# cp/get/put without slash, target directory exists
assert fs.isdir(target)
func(empty, target)
assert fs.find(target, withdirs=True) == []
assert fs.find(target, withdirs=True) == [target]

# cp/get/put with slash, target directory exists
assert fs.isdir(target)
func(empty + "/", target)
assert fs.find(target, withdirs=True) == []
assert fs.find(target, withdirs=True) == [target]

fs.rmdir(target)

Expand Down
4 changes: 2 additions & 2 deletions fsspec/implementations/tests/test_memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,12 +316,12 @@ def test_cp_empty_directory(m):
# cp without slash, target directory exists
assert m.isdir(target)
m.cp(empty, target)
assert m.find(target, withdirs=True) == []
assert m.find(target, withdirs=True) == [target]

# cp with slash, target directory exists
assert m.isdir(target)
m.cp(empty + "/", target)
assert m.find(target, withdirs=True) == []
assert m.find(target, withdirs=True) == [target]

m.rmdir(target)

Expand Down
2 changes: 1 addition & 1 deletion fsspec/implementations/tests/test_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def test_ls(server): # noqa: F811
assert fs.ls("", detail=False) == ["a", "b", "c"]
assert {"name": "c", "type": "directory", "size": 0} in fs.ls("", detail=True)
assert fs.find("") == ["a", "b", "c/d"]
assert fs.find("", withdirs=True) == ["a", "b", "c", "c/d"]
assert fs.find("", withdirs=True) == ["", "a", "b", "c", "c/d"]
assert fs.find("c", detail=True) == {
"c/d": {"name": "c/d", "size": 6, "type": "file"}
}
Expand Down
1 change: 1 addition & 0 deletions fsspec/implementations/tests/test_tar.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ def test_ls_with_folders(compression: str, tmp_path: Path):
with open(temp_archive_file, "rb") as fd:
fs = TarFileSystem(fd)
assert fs.find("/", withdirs=True) == [
"",
"a.pdf",
"b/",
"b/c.pdf",
Expand Down

0 comments on commit 2f33e1b

Please sign in to comment.