mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
deps: update dvc-data to >=3
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user