Files
dvc/tests/unit/command/test_add.py
T
Ruslan Kuprieiev 251a3269c2 dvcfile: add desc field for outs/stages (#4901)
Outs desc will be used by viewer right away. Stage desc is for people to
start using now, but we won't be using it it viewer until DAG support is
added there.
2020-11-18 22:06:52 +02:00

36 lines
745 B
Python

from dvc.cli import parse_args
from dvc.command.add import CmdAdd
def test_add(mocker, dvc):
cli_args = parse_args(
[
"add",
"--recursive",
"--no-commit",
"--external",
"--glob",
"--file",
"file",
"--desc",
"stage description",
"data",
]
)
assert cli_args.func == CmdAdd
cmd = cli_args.func(cli_args)
m = mocker.patch.object(cmd.repo, "add", autospec=True)
assert cmd.run() == 0
m.assert_called_once_with(
["data"],
recursive=True,
no_commit=True,
glob=True,
fname="file",
external=True,
desc="stage description",
)