Exemplo n.º 1
0
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)
Exemplo n.º 2
0
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
Exemplo n.º 3
0
 def _get_output(self):
     stage = Stage(self.dvc)
     return LocalOutput(stage, "path")
Exemplo n.º 4
0
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)