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 authored and efiop committed Jan 13, 2024
1 parent b46bd9c commit ecc01dc
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ dependencies = [
"configobj>=5.0.6",
"distro>=1.3",
"dpath<3,>=2.1.0",
"dvc-data>=3.7,<3.8",
# "dvc-data>=3.7,<3.8",
"dvc-data@git+https://github.com/efiop/dvc-data#egg=index-fetch-meta",
"dvc-http>=2.29.0",
"dvc-render>=1.0.0,<2",
"dvc-studio-client>=0.17.1,<1",
Expand Down
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 ecc01dc

Please sign in to comment.