mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
* import: add '--file' option Fixes #4093 * Update dvc/command/imp.py Co-authored-by: Ruslan Kuprieiev <[email protected]>
29 lines
609 B
Python
29 lines
609 B
Python
from dvc.cli import parse_args
|
|
from dvc.command.imp import CmdImport
|
|
|
|
|
|
def test_import(mocker):
|
|
cli_args = parse_args(
|
|
[
|
|
"import",
|
|
"repo_url",
|
|
"src",
|
|
"--out",
|
|
"out",
|
|
"--file",
|
|
"file",
|
|
"--rev",
|
|
"version",
|
|
]
|
|
)
|
|
assert cli_args.func == CmdImport
|
|
|
|
cmd = cli_args.func(cli_args)
|
|
m = mocker.patch.object(cmd.repo, "imp", autospec=True)
|
|
|
|
assert cmd.run() == 0
|
|
|
|
m.assert_called_once_with(
|
|
"repo_url", path="src", out="out", fname="file", rev="version"
|
|
)
|