(mocker, dvc)
| 3 | |
| 4 | |
| 5 | def 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 | |
| 48 | def test_import_no_exec(mocker, dvc): |
nothing calls this directly
no test coverage detected