MCPcopy
hub / github.com/treeverse/dvc / test_import

Function test_import

tests/unit/command/test_imp.py:5–45  ·  view source on GitHub ↗
(mocker, dvc)

Source from the content-addressed store, hash-verified

3
4
5def test_import(mocker, dvc):
6 cli_args = parse_args(
7 [
8 "import",
9 "repo_url",
10 "src",
11 "--out",
12 "out",
13 "--rev",
14 "version",
15 "--jobs",
16 "3",
17 "--config",
18 "myconfig",
19 "--remote",
20 "myremote",
21 "--remote-config",
22 "k1=v1",
23 "k2=v2",
24 ]
25 )
26 assert cli_args.func == CmdImport
27
28 cmd = cli_args.func(cli_args)
29 m = mocker.patch.object(cmd.repo, "imp", autospec=True)
30
31 assert cmd.run() == 0
32
33 m.assert_called_once_with(
34 "repo_url",
35 path="src",
36 out="out",
37 rev="version",
38 no_exec=False,
39 no_download=False,
40 jobs=3,
41 config="myconfig",
42 remote="myremote",
43 remote_config={"k1": "v1", "k2": "v2"},
44 force=False,
45 )
46
47
48def test_import_no_exec(mocker, dvc):

Callers

nothing calls this directly

Calls 3

parse_argsFunction · 0.90
funcMethod · 0.80
runMethod · 0.45

Tested by

no test coverage detected