Skip to content

Commit

Permalink
tests: pull after imp-url no-download
Browse files Browse the repository at this point in the history
  • Loading branch information
dberenbaum committed Jan 3, 2024
1 parent fe008d9 commit cf6f543
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/func/test_data_cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,28 @@ def test_pull_partial_import(tmp_dir, dvc, local_workspace):
assert stage.outs[0].get_hash().value == "d10b4c3ff123b26dc068d43a8bef2d23"


def test_pull_partial_import_missing(tmp_dir, dvc, local_workspace):
local_workspace.gen("file", "file content")
dst = tmp_dir / "file"
dvc.imp_url("remote://workspace/file", os.fspath(dst), no_download=True)

(local_workspace / "file").unlink()
with pytest.raises(CheckoutError):
dvc.pull("file")
assert not dst.exists()


def test_pull_partial_import_modified(tmp_dir, dvc, local_workspace):
local_workspace.gen("file", "file content")
dst = tmp_dir / "file"
dvc.imp_url("remote://workspace/file", os.fspath(dst), no_download=True)

local_workspace.gen("file", "updated file content")
with pytest.raises(CheckoutError):
dvc.pull("file")
assert not dst.exists()


def test_pull_external_dvc_imports_mixed(tmp_dir, dvc, scm, erepo_dir, local_remote):
with erepo_dir.chdir():
erepo_dir.dvc_gen("foo", "foo", commit="first")
Expand Down

0 comments on commit cf6f543

Please sign in to comment.