tests: dvcfs: use fspath while testing (#9872)

get_file does not support PathLike objects. fsspec does not support them in get_file.

See https://github.com/fsspec/filesystem_spec/issues/896.
Fixes test failures in dvc-webhdfs and dvc-hdfs.
This commit is contained in:
skshetry
2023-08-23 17:33:22 +05:45
committed by GitHub
parent 8e353f9fce
commit 8cb7e4948d
+2 -2
View File
@@ -117,10 +117,10 @@ class TestAPI:
assert fobj.read() == b"script1"
tmp = make_tmp_dir("temp-download")
fs.get_file("data/foo", tmp / "foo")
fs.get_file("data/foo", (tmp / "foo").fs_path)
assert (tmp / "foo").read_text() == "foo"
fs.get_file("scripts/script1", tmp / "script1")
fs.get_file("scripts/script1", (tmp / "script1").fs_path)
assert (tmp / "script1").read_text() == "script1"
fs.get("/", (tmp / "all").fs_path, recursive=True)