deps: update dvc-data to >=3

This commit is contained in:
Ruslan Kuprieiev
2023-12-15 08:02:40 +02:00
parent 766b43bc2d
commit 3e4e143bee
44 changed files with 266 additions and 269 deletions
+8 -8
View File
@@ -13,15 +13,15 @@ def test_cleanfs_subrepo(tmp_dir, dvc, scm, monkeypatch):
path = subrepo_dir.fs_path
assert dvc.fs.exists(dvc.fs.path.join(path, "foo"))
assert dvc.fs.isfile(dvc.fs.path.join(path, "foo"))
assert dvc.fs.exists(dvc.fs.path.join(path, "dir"))
assert dvc.fs.isdir(dvc.fs.path.join(path, "dir"))
assert dvc.fs.exists(dvc.fs.join(path, "foo"))
assert dvc.fs.isfile(dvc.fs.join(path, "foo"))
assert dvc.fs.exists(dvc.fs.join(path, "dir"))
assert dvc.fs.isdir(dvc.fs.join(path, "dir"))
assert subrepo.fs.exists(subrepo.fs.path.join(path, "foo"))
assert subrepo.fs.isfile(subrepo.fs.path.join(path, "foo"))
assert subrepo.fs.exists(subrepo.fs.path.join(path, "dir"))
assert subrepo.fs.isdir(subrepo.fs.path.join(path, "dir"))
assert subrepo.fs.exists(subrepo.fs.join(path, "foo"))
assert subrepo.fs.isfile(subrepo.fs.join(path, "foo"))
assert subrepo.fs.exists(subrepo.fs.join(path, "dir"))
assert subrepo.fs.isdir(subrepo.fs.join(path, "dir"))
def test_walk_dont_ignore_subrepos(tmp_dir, scm, dvc):
-29
View File
@@ -1,29 +0,0 @@
import pytest
from dvc.fs import Path
@pytest.mark.parametrize("prefix", ["", "/"])
@pytest.mark.parametrize("postfix", ["", "/"])
@pytest.mark.parametrize(
"path,expected",
[
("path", ("path",)),
("some/path", ("some", "path")),
],
)
def test_parts_posix(prefix, postfix, path, expected):
assert Path("/").parts(prefix + path + postfix) == tuple(prefix) + expected
@pytest.mark.parametrize("postfix", ["", "\\"])
@pytest.mark.parametrize(
"path,expected",
[
("path", ("path",)),
("c:\\path", ("c:", "\\", "path")),
("some\\path", ("some", "path")),
],
)
def test_parts_nt(postfix, path, expected):
assert Path("\\").parts(path + postfix) == expected
+4 -5
View File
@@ -173,11 +173,10 @@ def test_match_ignore_from_file(
)
dvcignore_dirname = os.path.dirname(dvcignore_path)
fs = mocker.MagicMock()
fs.path = localfs.path
fs.sep = localfs.sep
mocker.patch.object(fs, "open", mocker.mock_open(read_data="\n".join(patterns)))
ignore_file = DvcIgnorePatterns.from_file(dvcignore_path, fs, "mocked")
mocker.patch.object(
localfs, "open", mocker.mock_open(read_data="\n".join(patterns))
)
ignore_file = DvcIgnorePatterns.from_file(dvcignore_path, localfs, "mocked")
assert (
ignore_file.matches(dvcignore_dirname, file_to_ignore_relpath) == expected_match