mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
* metrics/plots/params: return ordered * metrics/params/plots: add tests for return order
23 lines
648 B
Python
23 lines
648 B
Python
import os
|
|
|
|
from dvc.utils.serialize import dumps_yaml
|
|
|
|
|
|
def test_params_order(tmp_dir, dvc, dummy_stage):
|
|
tmp_dir.gen(
|
|
{
|
|
"params.yaml": dumps_yaml({"p1": 1}),
|
|
"p1.yaml": dumps_yaml({"p2": 1}),
|
|
"sub": {"p2.yaml": dumps_yaml({"p3": 1})},
|
|
}
|
|
)
|
|
|
|
p2_path = os.path.join("sub", "p2.yaml")
|
|
sub_stage = os.path.join("sub", "dvc.yaml")
|
|
|
|
dummy_stage(params=[{p2_path: ["p3"]}, {"p1.yaml": ["p2"]}])
|
|
dummy_stage(path=sub_stage, params=["p1"])
|
|
|
|
# params are sorted during dumping, therefore p1 is first
|
|
assert list(dvc.params.show()[""]) == ["p1.yaml", p2_path, "params.yaml"]
|