From 5d69f57abf3acd8ce53ec492d5cb0cab18184f3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniele=20Trifir=C3=B2?= Date: Wed, 21 Sep 2022 22:59:58 +0200 Subject: [PATCH] tests: add test_partial_import_pull --- tests/func/test_import_url.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/func/test_import_url.py b/tests/func/test_import_url.py index 795327f7f..8417f9200 100644 --- a/tests/func/test_import_url.py +++ b/tests/func/test_import_url.py @@ -8,6 +8,7 @@ import pytest from dvc.annotations import Annotation from dvc.cli import main from dvc.dependency.base import Dependency, DependencyDoesNotExistError +from dvc.dvcfile import Dvcfile from dvc.exceptions import InvalidArgumentError from dvc.stage import Stage from dvc.testing.workspace_tests import TestImport as _TestImport @@ -304,6 +305,21 @@ def test_import_url_no_download(tmp_dir, scm, dvc, local_workspace): ] +def test_partial_import_pull(tmp_dir, scm, 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) + + dvc.pull(["file.dvc"]) + + assert dst.exists() + + stage = Dvcfile(dvc, "file.dvc").stage + + assert stage.outs[0].hash_info.value == "d10b4c3ff123b26dc068d43a8bef2d23" + assert stage.outs[0].meta.size == 12 + + def test_imp_url_with_annotations(M, tmp_dir, dvc, local_workspace): local_workspace.gen("foo", "foo") annot = {