mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
* plots: support images initial * plots: data: unify PlotsData * plots: data conversion refactor * plots: renderers: abstract functionality * plots: uncommenting tests * plots: self implement grouping * plots: rename group * plots: extract rendering tests * plots: move rendering tests to unit * plots: add image rendering tests * plots: dont use dpath to find vega plot * plots: test find_vega * plots: test render function * plots: move rendering out of repo package * plots: refactoring * plots: self review refactor
37 lines
896 B
Python
37 lines
896 B
Python
import json
|
|
import os
|
|
|
|
from dvc.render.utils import get_files
|
|
|
|
|
|
def test_plots_order(tmp_dir, dvc):
|
|
tmp_dir.gen(
|
|
{
|
|
"p.json": json.dumps([{"p1": 1}, {"p1": 2}]),
|
|
"p1.json": json.dumps([{"p2": 1}, {"p2": 2}]),
|
|
"sub": {
|
|
"p3.json": json.dumps([{"p3": 1}, {"p3": 2}]),
|
|
"p4.json": json.dumps([{"p4": 1}, {"p4": 2}]),
|
|
},
|
|
}
|
|
)
|
|
|
|
dvc.stage.add(
|
|
plots=["p.json", str(tmp_dir / "sub" / "p4.json")],
|
|
cmd="cmd1",
|
|
name="stage1",
|
|
)
|
|
with (tmp_dir / "sub").chdir():
|
|
dvc.stage.add(
|
|
plots=[str(tmp_dir / "p1.json"), "p3.json"],
|
|
cmd="cmd2",
|
|
name="stage2",
|
|
)
|
|
|
|
assert get_files(dvc.plots.show()) == {
|
|
"p.json",
|
|
os.path.join("sub", "p4.json"),
|
|
"p1.json",
|
|
os.path.join("sub", "p3.json"),
|
|
}
|