mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-04 23:09:44 +01:00
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.
36 lines
745 B
Python
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",
|
|
)
|