forked from iterative/dvc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
push/pull/status/metrics: add support for
--all-commits
(iterative#…
…3587) First steps for iterative#1691
- Loading branch information
Showing
11 changed files
with
250 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
from dvc.cli import parse_args | ||
from dvc.command.data_sync import CmdDataFetch, CmdDataPull, CmdDataPush | ||
|
||
|
||
def test_fetch(mocker): | ||
cli_args = parse_args( | ||
[ | ||
"fetch", | ||
"target1", | ||
"target2", | ||
"--jobs", | ||
"2", | ||
"--remote", | ||
"remote", | ||
"--all-branches", | ||
"--all-tags", | ||
"--all-commits", | ||
"--with-deps", | ||
"--recursive", | ||
] | ||
) | ||
assert cli_args.func == CmdDataFetch | ||
|
||
cmd = cli_args.func(cli_args) | ||
m = mocker.patch.object(cmd.repo, "fetch", autospec=True) | ||
|
||
assert cmd.run() == 0 | ||
|
||
m.assert_called_once_with( | ||
targets=["target1", "target2"], | ||
jobs=2, | ||
remote="remote", | ||
all_branches=True, | ||
all_tags=True, | ||
all_commits=True, | ||
with_deps=True, | ||
recursive=True, | ||
) | ||
|
||
|
||
def test_pull(mocker): | ||
cli_args = parse_args( | ||
[ | ||
"pull", | ||
"target1", | ||
"target2", | ||
"--jobs", | ||
"2", | ||
"--remote", | ||
"remote", | ||
"--all-branches", | ||
"--all-tags", | ||
"--all-commits", | ||
"--with-deps", | ||
"--force", | ||
"--recursive", | ||
] | ||
) | ||
assert cli_args.func == CmdDataPull | ||
|
||
cmd = cli_args.func(cli_args) | ||
m = mocker.patch.object(cmd.repo, "pull", autospec=True) | ||
|
||
assert cmd.run() == 0 | ||
|
||
m.assert_called_once_with( | ||
targets=["target1", "target2"], | ||
jobs=2, | ||
remote="remote", | ||
all_branches=True, | ||
all_tags=True, | ||
all_commits=True, | ||
with_deps=True, | ||
force=True, | ||
recursive=True, | ||
) | ||
|
||
|
||
def test_push(mocker): | ||
cli_args = parse_args( | ||
[ | ||
"push", | ||
"target1", | ||
"target2", | ||
"--jobs", | ||
"2", | ||
"--remote", | ||
"remote", | ||
"--all-branches", | ||
"--all-tags", | ||
"--all-commits", | ||
"--with-deps", | ||
"--recursive", | ||
] | ||
) | ||
assert cli_args.func == CmdDataPush | ||
|
||
cmd = cli_args.func(cli_args) | ||
m = mocker.patch.object(cmd.repo, "push", autospec=True) | ||
|
||
assert cmd.run() == 0 | ||
|
||
m.assert_called_once_with( | ||
targets=["target1", "target2"], | ||
jobs=2, | ||
remote="remote", | ||
all_branches=True, | ||
all_tags=True, | ||
all_commits=True, | ||
with_deps=True, | ||
recursive=True, | ||
) |
Oops, something went wrong.