MCPcopy
hub / github.com/treeverse/dvc / test_config_output_dir

Function test_config_output_dir

tests/integration/plots/test_plots.py:408–429  ·  view source on GitHub ↗
(tmp_dir, dvc, capsys)

Source from the content-addressed store, hash-verified

406
407
408def test_config_output_dir(tmp_dir, dvc, capsys):
409 subdir = tmp_dir / "subdir"
410 ret = main(["config", "plots.out_dir", os.fspath(subdir)])
411 assert ret == 0
412
413 metric = [{"first_val": 100, "val": 2}, {"first_val": 200, "val": 3}]
414 (tmp_dir / "metric.json").dump_json(metric, sort_keys=True)
415
416 assert main(["plots", "show", "metric.json"]) == 0
417
418 out, _ = capsys.readouterr()
419 assert subdir.as_uri() in out
420 assert subdir.is_dir()
421 assert (subdir / "index.html").is_file()
422
423 cli_arg_subdir = tmp_dir / "cli_option"
424 assert main(["plots", "show", "-o", os.fspath(cli_arg_subdir), "metric.json"]) == 0
425
426 out, _ = capsys.readouterr()
427 assert cli_arg_subdir.as_uri() in out
428 assert cli_arg_subdir.is_dir()
429 assert (cli_arg_subdir / "index.html").is_file()
430
431
432@pytest.mark.vscode

Callers

nothing calls this directly

Calls 5

mainFunction · 0.90
dump_jsonMethod · 0.80
is_dirMethod · 0.80
is_fileMethod · 0.80
fspathMethod · 0.45

Tested by

no test coverage detected