Move test to test_data_cloud.

This commit is contained in:
Karthikeyan Singaravelan
2022-05-11 18:37:09 +03:00
committed by Ruslan Kuprieiev
parent 9b3873c4f0
commit 8d99ce06aa
2 changed files with 17 additions and 20 deletions
+16
View File
@@ -8,6 +8,7 @@ from flaky.flaky_decorator import flaky
import dvc as dvc_module
from dvc.cli import main
from dvc.data.db.local import LocalObjectDB
from dvc.exceptions import GlobDoesNotMatchError
from dvc.external_repo import clean_repos
from dvc.objects.db import ObjectDB
from dvc.stage.exceptions import StageNotFound
@@ -570,3 +571,18 @@ def test_target_remote(tmp_dir, dvc, make_remote):
"6b18131dc289fd37006705affe961ef8.dir",
"b8a9f715dbb64fd5c56e7783c6820a61",
}
def test_push_pull_glob_no_match(
tmp_dir, dvc, erepo_dir, run_copy, local_remote
):
tmp_dir.gen("foo", "foo")
erepo_dir.add_remote(config=local_remote.config)
with erepo_dir.chdir():
with pytest.raises(GlobDoesNotMatchError):
dvc.push(targets="b*", glob=True)
with pytest.raises(GlobDoesNotMatchError):
dvc.pull(targets="b*", glob=True)
assert not os.path.exists(erepo_dir.dvc.stage_cache.cache_dir)
+1 -20
View File
@@ -9,11 +9,7 @@ from scmrepo.git import Git
from dvc.config import NoRemoteError
from dvc.data.db import ODBManager
from dvc.dvcfile import Dvcfile
from dvc.exceptions import (
DownloadError,
GlobDoesNotMatchError,
PathMissingError,
)
from dvc.exceptions import DownloadError, PathMissingError
from dvc.stage.exceptions import StagePathNotFoundError
from dvc.system import System
from dvc.utils.fs import makedirs, remove
@@ -270,21 +266,6 @@ def test_pull_wildcard_imported_directory_stage(tmp_dir, dvc, erepo_dir):
assert (tmp_dir / "dir_imported123").read_text() == {"foo": "foo content"}
def test_push_pull_glob_no_match(
tmp_dir, dvc, erepo_dir, run_copy, local_remote
):
tmp_dir.gen("foo", "foo")
erepo_dir.add_remote(config=local_remote.config)
with erepo_dir.chdir():
with pytest.raises(GlobDoesNotMatchError):
dvc.push(targets="b*", glob=True)
with pytest.raises(GlobDoesNotMatchError):
dvc.pull(targets="b*", glob=True)
assert not os.path.exists(erepo_dir.dvc.stage_cache.cache_dir)
def test_push_wildcard_from_bare_git_repo(
tmp_dir, make_tmp_dir, erepo_dir, local_cloud
):