repofs: use repo paths

This commit is contained in:
Ruslan Kuprieiev
2022-04-18 14:17:20 +03:00
parent b3b0ec1fba
commit 9d75e8261b
20 changed files with 214 additions and 200 deletions
+10 -10
View File
@@ -32,9 +32,9 @@ def test_new_checkpoint(
if rev == "workspace":
continue
fs = dvc.repo_fs
with fs.open((tmp_dir / "foo").fs_path) as fobj:
with fs.open("foo") as fobj:
assert fobj.read().strip() == str(checkpoint_stage.iterations)
with fs.open((tmp_dir / "metrics.yaml").fs_path) as fobj:
with fs.open("metrics.yaml") as fobj:
assert fobj.read().strip() == "foo: 2"
if workspace:
@@ -81,9 +81,9 @@ def test_resume_checkpoint(
if rev == "workspace":
continue
fs = dvc.repo_fs
with fs.open((tmp_dir / "foo").fs_path) as fobj:
with fs.open("foo") as fobj:
assert fobj.read().strip() == str(2 * checkpoint_stage.iterations)
with fs.open((tmp_dir / "metrics.yaml").fs_path) as fobj:
with fs.open("metrics.yaml") as fobj:
assert fobj.read().strip() == "foo: 2"
if workspace:
@@ -112,9 +112,9 @@ def test_reset_checkpoint(
if rev == "workspace":
continue
fs = dvc.repo_fs
with fs.open((tmp_dir / "foo").fs_path) as fobj:
with fs.open("foo") as fobj:
assert fobj.read().strip() == str(checkpoint_stage.iterations)
with fs.open((tmp_dir / "metrics.yaml").fs_path) as fobj:
with fs.open("metrics.yaml") as fobj:
assert fobj.read().strip() == "foo: 2"
if workspace:
@@ -151,18 +151,18 @@ def test_resume_branch(tmp_dir, scm, dvc, checkpoint_stage, workspace):
if rev == "workspace":
continue
fs = dvc.repo_fs
with fs.open((tmp_dir / "foo").fs_path) as fobj:
with fs.open("foo") as fobj:
assert fobj.read().strip() == str(2 * checkpoint_stage.iterations)
with fs.open((tmp_dir / "metrics.yaml").fs_path) as fobj:
with fs.open("metrics.yaml") as fobj:
assert fobj.read().strip() == "foo: 2"
for rev in dvc.brancher([checkpoint_b]):
if rev == "workspace":
continue
fs = dvc.repo_fs
with fs.open((tmp_dir / "foo").fs_path) as fobj:
with fs.open("foo") as fobj:
assert fobj.read().strip() == str(2 * checkpoint_stage.iterations)
with fs.open((tmp_dir / "metrics.yaml").fs_path) as fobj:
with fs.open("metrics.yaml") as fobj:
assert fobj.read().strip() == "foo: 100"
with pytest.raises(MultipleBranchError):
+2 -2
View File
@@ -675,9 +675,9 @@ def test_modified_data_dep(tmp_dir, scm, dvc, workspace, params, target):
for rev in dvc.brancher(revs=[exp]):
if rev != exp:
continue
with dvc.repo_fs.open((tmp_dir / "metrics.yaml").fs_path) as fobj:
with dvc.repo_fs.open("metrics.yaml") as fobj:
assert fobj.read().strip() == params
with dvc.repo_fs.open((tmp_dir / "data").fs_path) as fobj:
with dvc.repo_fs.open("data") as fobj:
assert fobj.read().strip() == "modified"
if workspace: