def test_str_workdir_inside_repo(dvc): stage = Stage(dvc) output = LocalOutput(stage, "path", cache=False) assert "path" == str(output) stage = Stage(dvc, wdir="some_folder") output = LocalOutput(stage, "path", cache=False) assert os.path.join("some_folder", "path") == str(output)
def test_str_on_external_absolute_path(dvc): stage = Stage(dvc) rel_path = os.path.join("..", "path", "to", "file") abs_path = os.path.abspath(rel_path) output = LocalOutput(stage, abs_path, cache=False) assert output.def_path == abs_path assert output.path_info.fspath == abs_path assert str(output) == abs_path
def _get_output(self): stage = Stage(self.dvc) return LocalOutput(stage, "path")
def test_str_workdir_outside_repo(erepo_dir): stage = Stage(erepo_dir.dvc) output = LocalOutput(stage, "path", cache=False) assert relpath("path", erepo_dir.dvc.root_dir) == str(output)