mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-29 07:18:27 +01:00
data cloud: verify is config option now
This commit is contained in:
@@ -280,6 +280,11 @@ def test_verify_checksums(tmp_dir, erepo_dir, mocker):
|
||||
|
||||
# Removing cache will invalidate existing state entries
|
||||
shutil.rmtree(dvc.cache.local.cache_dir)
|
||||
dvc.config.set(
|
||||
Config.SECTION_REMOTE_FMT.format("upstream"),
|
||||
Config.SECTION_REMOTE_VERIFY,
|
||||
"True",
|
||||
)
|
||||
|
||||
dvc.pull(verify=True)
|
||||
dvc.pull()
|
||||
assert file_md5_spy.call_count == 3
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
from dvc.cli import parse_args
|
||||
from dvc.command.data_sync import CmdDataFetch, CmdDataPull
|
||||
|
||||
|
||||
def test_fetch(mocker):
|
||||
cli_args = parse_args(
|
||||
[
|
||||
"fetch",
|
||||
"target.dvc",
|
||||
"-r",
|
||||
"remote",
|
||||
"-a",
|
||||
"-T",
|
||||
"-d",
|
||||
"-R",
|
||||
"--verify",
|
||||
"-j",
|
||||
"2",
|
||||
]
|
||||
)
|
||||
assert cli_args.func == CmdDataFetch
|
||||
|
||||
cmd = cli_args.func(cli_args)
|
||||
m = mocker.patch("dvc.repo.Repo.fetch")
|
||||
|
||||
assert cmd.run() == 0
|
||||
|
||||
m.assert_called_once_with(
|
||||
targets=["target.dvc"],
|
||||
remote="remote",
|
||||
all_branches=True,
|
||||
all_tags=True,
|
||||
with_deps=True,
|
||||
recursive=True,
|
||||
verify=True,
|
||||
jobs=2,
|
||||
)
|
||||
|
||||
|
||||
def test_pull(mocker):
|
||||
cli_args = parse_args(
|
||||
[
|
||||
"pull",
|
||||
"target.dvc",
|
||||
"-r",
|
||||
"remote",
|
||||
"-a",
|
||||
"-T",
|
||||
"-d",
|
||||
"-R",
|
||||
"-f",
|
||||
"--verify",
|
||||
"-j",
|
||||
"2",
|
||||
]
|
||||
)
|
||||
assert cli_args.func == CmdDataPull
|
||||
|
||||
cmd = cli_args.func(cli_args)
|
||||
m = mocker.patch("dvc.repo.Repo.pull")
|
||||
|
||||
assert cmd.run() == 0
|
||||
|
||||
m.assert_called_once_with(
|
||||
targets=["target.dvc"],
|
||||
remote="remote",
|
||||
all_branches=True,
|
||||
all_tags=True,
|
||||
with_deps=True,
|
||||
recursive=True,
|
||||
force=True,
|
||||
verify=True,
|
||||
jobs=2,
|
||||
)
|
||||
Reference in New Issue
Block a user