Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] dvc: wrap checkout error as download error #2608

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dvc/repo/pull.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def pull(
with_deps=with_deps,
recursive=recursive,
)
# This throws CheckoutError
self._checkout(
targets=targets, with_deps=with_deps, force=force, recursive=recursive
)
Expand Down
7 changes: 7 additions & 0 deletions tests/func/test_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import os
import filecmp
import shutil

import pytest
from mock import patch
Expand Down Expand Up @@ -84,6 +85,12 @@ def test_download_error_pulling_imported_stage(dvc_repo, erepo):
), pytest.raises(DownloadError):
dvc_repo.pull(["foo_imported.dvc"])

# When repo is absent we should still get DownloadError
shutil.rmtree(erepo.dvc.cache.local.cache_dir)

with pytest.raises(DownloadError):
dvc_repo.pull(["foo_imported.dvc"])


@pytest.mark.parametrize("dname", [".", "dir", "dir/subdir"])
def test_import_to_dir(dname, repo_dir, dvc_repo, erepo):
Expand Down