Files
dvc/tests/unit/command/test_live.py
T
Paweł Redzyński 21af7438db plots/metrics/params/experiments show: stop throwing exceptions (#5984)
* params/metrics/plots/exp show: introduce onerror

* fixup

* plots/metrics/params: removing errors

* removing more errors

* removing errors

* some more removing

* new plots ux

* new ux for metrics

* new ux for params

* fixing tests

* fixups

* minor test fixes

* minor test fixes

* commands: plots/params: fix ui imports

* working on error handlng decorator, stopped at show checkpoints

* error_handler, further dvelopment

* plots just before moving loading to collect

* appending errors to results: initial passing

* fixup

* onerror: remove onerror fixture

* fixups

* plots/metrics/params/experiments: temporarily remove error warnings

* plots: extract parsing out of class method

* metrics/experiments: provide exception serializer for show-json

* params/plots/metrics: signal errors

* rebase fixups

* fix TODOs

* fixup

* skshetry's review refactor
2021-07-16 15:36:04 +02:00

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() == 1
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() == 1
m.assert_called_once_with(target="datafile", revs=None)