mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-05 23:09:32 +01:00
* Added `--md`/`--show-md` option to `exp show`. * Added test_show_experiments_md * Fixed re-defining all_experiments * Fixed all_experiments * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Added dest markdown * Added textwrap.dedent * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update experiments.py * Apply suggestions from code review Co-authored-by: Saugat Pachhai <[email protected]> * Update tests/unit/command/test_compat_flag.py Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Saugat Pachhai <[email protected]>
40 lines
1.3 KiB
Python
40 lines
1.3 KiB
Python
from itertools import takewhile
|
|
|
|
import pytest
|
|
|
|
from dvc.cli import parse_args
|
|
|
|
|
|
def _id_gen(val) -> str:
|
|
if isinstance(val, list):
|
|
return "-".join(takewhile(lambda v: not v.startswith("-"), val))
|
|
return str(val)
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
"args, key",
|
|
[
|
|
(["diff", "--show-json"], "json"),
|
|
(["diff", "--show-md"], "markdown"),
|
|
(["experiments", "diff", "--show-json"], "json"),
|
|
(["experiments", "diff", "--show-md"], "markdown"),
|
|
(["experiments", "show", "--show-json"], "json"),
|
|
(["experiments", "show", "--show-csv"], "csv"),
|
|
(["experiments", "show", "--show-md"], "markdown"),
|
|
(["ls", "--show-json", "."], "json"),
|
|
(["metrics", "diff", "--show-json"], "json"),
|
|
(["metrics", "diff", "--show-md"], "markdown"),
|
|
(["metrics", "show", "--show-json"], "json"),
|
|
(["metrics", "show", "--show-md"], "markdown"),
|
|
(["params", "diff", "--show-json"], "json"),
|
|
(["params", "diff", "--show-md"], "markdown"),
|
|
(["status", "--show-json"], "json"),
|
|
],
|
|
ids=_id_gen,
|
|
)
|
|
def test_backward_compat_flags(args, key):
|
|
"""Test support for --show-csv/--show-json/--show-md flags."""
|
|
cli_args = parse_args(args)
|
|
d = vars(cli_args)
|
|
assert d[key] is True
|