From 1143a8c57f7c61ebe5b4c57560c3ebf0ece703e9 Mon Sep 17 00:00:00 2001 From: Alexander Schepanovski Date: Thu, 12 Dec 2019 19:48:04 +0700 Subject: [PATCH] test: add checkout parse-cli-api test --- tests/unit/command/test_checkout.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tests/unit/command/test_checkout.py diff --git a/tests/unit/command/test_checkout.py b/tests/unit/command/test_checkout.py new file mode 100644 index 000000000..21fc7920e --- /dev/null +++ b/tests/unit/command/test_checkout.py @@ -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, + )