mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-01 23:08:43 +01:00
test: add checkout parse-cli-api test
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
from dvc.cli import parse_args
|
||||
from dvc.command.checkout import CmdCheckout
|
||||
|
||||
|
||||
def test_checkout(tmp_dir, dvc, mocker):
|
||||
cli_args = parse_args(
|
||||
["checkout", "foo.dvc", "bar.dvc", "--relink", "--with-deps"]
|
||||
)
|
||||
assert cli_args.func == CmdCheckout
|
||||
|
||||
cmd = cli_args.func(cli_args)
|
||||
m = mocker.patch("dvc.repo.Repo.checkout")
|
||||
|
||||
assert cmd.run() == 0
|
||||
m.assert_called_once_with(
|
||||
targets=["foo.dvc", "bar.dvc"],
|
||||
force=False,
|
||||
recursive=False,
|
||||
relink=True,
|
||||
with_deps=True,
|
||||
)
|
||||
Reference in New Issue
Block a user