Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve test coverage #1508

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions fsspec/tests/abstract/copy.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def test_copy_directory_to_existing_directory(
fs.touch(dummy)
assert fs.isdir(target)

for source_slash, target_slash in zip([False, True], [False, True]):
for source_slash, target_slash in product([False, True], [False, True]):
s = fs_join(source, "subdir")
if source_slash:
s += "/"
Expand Down Expand Up @@ -195,7 +195,7 @@ def test_copy_directory_to_new_directory(
target = fs_target
fs.mkdir(target)

for source_slash, target_slash in zip([False, True], [False, True]):
for source_slash, target_slash in product([False, True], [False, True]):
s = fs_join(source, "subdir")
if source_slash:
s += "/"
Expand Down Expand Up @@ -274,7 +274,7 @@ def test_copy_glob_to_existing_directory(
assert fs.ls(target) == ([] if supports_empty_directories else [dummy])

# With recursive
for glob, recursive in zip(["*", "**"], [True, False]):
for glob, recursive in product(["*", "**"], [True, False]):
fs.cp(fs_join(source, "subdir", glob), t, recursive=recursive)
assert fs.isfile(fs_join(target, "subfile1"))
assert fs.isfile(fs_join(target, "subfile2"))
Expand Down Expand Up @@ -338,7 +338,7 @@ def test_copy_glob_to_new_directory(
assert not fs.exists(fs_join(target, "newdir"))

# With recursive
for glob, recursive in zip(["*", "**"], [True, False]):
for glob, recursive in product(["*", "**"], [True, False]):
fs.cp(fs_join(source, "subdir", glob), t, recursive=recursive)
assert fs.isdir(fs_join(target, "newdir"))
assert fs.isfile(fs_join(target, "newdir", "subfile1"))
Expand Down
8 changes: 4 additions & 4 deletions fsspec/tests/abstract/get.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def test_get_directory_to_existing_directory(
local_fs.mkdir(target)
assert local_fs.isdir(target)

for source_slash, target_slash in zip([False, True], [False, True]):
for source_slash, target_slash in product([False, True], [False, True]):
s = fs_join(source, "subdir")
if source_slash:
s += "/"
Expand Down Expand Up @@ -205,7 +205,7 @@ def test_get_directory_to_new_directory(
target = local_target
local_fs.mkdir(target)

for source_slash, target_slash in zip([False, True], [False, True]):
for source_slash, target_slash in product([False, True], [False, True]):
s = fs_join(source, "subdir")
if source_slash:
s += "/"
Expand Down Expand Up @@ -278,7 +278,7 @@ def test_get_glob_to_existing_directory(
assert local_fs.ls(target) == []

# With recursive
for glob, recursive in zip(["*", "**"], [True, False]):
for glob, recursive in product(["*", "**"], [True, False]):
fs.get(fs_join(source, "subdir", glob), t, recursive=recursive)
assert local_fs.isfile(local_join(target, "subfile1"))
assert local_fs.isfile(local_join(target, "subfile2"))
Expand Down Expand Up @@ -350,7 +350,7 @@ def test_get_glob_to_new_directory(
assert local_fs.ls(target) == []

# With recursive
for glob, recursive in zip(["*", "**"], [True, False]):
for glob, recursive in product(["*", "**"], [True, False]):
fs.get(fs_join(source, "subdir", glob), t, recursive=recursive)
assert local_fs.isdir(local_join(target, "newdir"))
assert local_fs.isfile(local_join(target, "newdir", "subfile1"))
Expand Down
8 changes: 4 additions & 4 deletions fsspec/tests/abstract/put.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def test_put_directory_to_existing_directory(
fs.touch(dummy)
assert fs.isdir(target)

for source_slash, target_slash in zip([False, True], [False, True]):
for source_slash, target_slash in product([False, True], [False, True]):
s = fs_join(source, "subdir")
if source_slash:
s += "/"
Expand Down Expand Up @@ -198,7 +198,7 @@ def test_put_directory_to_new_directory(
target = fs_target
fs.mkdir(target)

for source_slash, target_slash in zip([False, True], [False, True]):
for source_slash, target_slash in product([False, True], [False, True]):
s = fs_join(source, "subdir")
if source_slash:
s += "/"
Expand Down Expand Up @@ -278,7 +278,7 @@ def test_put_glob_to_existing_directory(
assert fs.ls(target) == ([] if supports_empty_directories else [dummy])

# With recursive
for glob, recursive in zip(["*", "**"], [True, False]):
for glob, recursive in product(["*", "**"], [True, False]):
fs.put(local_join(source, "subdir", glob), t, recursive=recursive)
assert fs.isfile(fs_join(target, "subfile1"))
assert fs.isfile(fs_join(target, "subfile2"))
Expand Down Expand Up @@ -345,7 +345,7 @@ def test_put_glob_to_new_directory(
assert not fs.exists(fs_join(target, "newdir"))

# With recursive
for glob, recursive in zip(["*", "**"], [True, False]):
for glob, recursive in product(["*", "**"], [True, False]):
fs.put(local_join(source, "subdir", glob), t, recursive=recursive)
assert fs.isdir(fs_join(target, "newdir"))
assert fs.isfile(fs_join(target, "newdir", "subfile1"))
Expand Down
Loading