mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-10 15:28:34 +01:00
repofs: use repo paths
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user