Skip to content

Commit 14896b7

Browse files
tests(parsing): add a test to incrase code coverage
1 parent 0b5298a commit 14896b7

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/func/parsing/test_params_templating.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,3 +1086,25 @@ def test_missing_params_file(self, tmp_dir, dvc):
10861086

10871087
with pytest.raises(ResolveError, match="does not exist"):
10881088
resolver.resolve()
1089+
1090+
def test_has_params_interpolation_with_dict_values(self, tmp_dir, dvc):
1091+
"""Test has_params_interpolation with dict containing param interpolation."""
1092+
# Test with dict containing param interpolation
1093+
dvc_yaml = {
1094+
"stages": {
1095+
"train": {
1096+
"cmd": f"echo ${{{PARAMS_NAMESPACE}.lr}}",
1097+
"outs": {"model.pkl": {"cache": f"${{{PARAMS_NAMESPACE}.cache}}"}},
1098+
"params": [{DEFAULT_PARAMS_FILE: []}],
1099+
}
1100+
}
1101+
}
1102+
1103+
(tmp_dir / DEFAULT_PARAMS_FILE).dump({"lr": 0.001, "cache": True})
1104+
resolver = DataResolver(dvc, tmp_dir.fs_path, dvc_yaml)
1105+
1106+
# Should raise error because params interpolation in outs (dict value)
1107+
with pytest.raises(
1108+
ResolveError, match="interpolation is not allowed in 'outs'"
1109+
):
1110+
resolver.resolve()

0 commit comments

Comments
 (0)