mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-06 15:28:28 +01:00
* pre-commit: update black to 21.5b1 also updated others, but black is more noticeable * remove magic trailing comma
41 lines
960 B
Python
41 lines
960 B
Python
from dvc.cli import parse_args
|
|
from dvc.command.live import CmdLiveDiff, CmdLiveShow
|
|
|
|
|
|
def test_live_diff(dvc, mocker):
|
|
cli_args = parse_args(
|
|
[
|
|
"live",
|
|
"diff",
|
|
"--out",
|
|
"result.extension",
|
|
"target",
|
|
"--revs",
|
|
"HEAD",
|
|
"rev1",
|
|
]
|
|
)
|
|
assert cli_args.func == CmdLiveDiff
|
|
|
|
cmd = cli_args.func(cli_args)
|
|
m = mocker.patch("dvc.repo.live.Live.show", return_value=({}, {}))
|
|
|
|
assert cmd.run() == 0
|
|
|
|
m.assert_called_once_with(target="target", revs=["HEAD", "rev1"])
|
|
|
|
|
|
def test_live_show(dvc, mocker):
|
|
cli_args = parse_args(
|
|
["live", "show", "-o", "result.extension", "datafile"]
|
|
)
|
|
assert cli_args.func == CmdLiveShow
|
|
|
|
cmd = cli_args.func(cli_args)
|
|
|
|
m = mocker.patch("dvc.repo.live.Live.show", return_value=({}, {}))
|
|
|
|
assert cmd.run() == 0
|
|
|
|
m.assert_called_once_with(target="datafile", revs=None)
|