mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-10 23:10:42 +01:00
tests: indices syntax for parametrization (#4930)
This commit is contained in:
@@ -82,10 +82,10 @@ def test_resolve_primitives_list_access():
|
||||
}
|
||||
)
|
||||
|
||||
assert context.resolve("${dict.0.f}") == "f"
|
||||
assert context.resolve("${dict.1.fo}") == "fo"
|
||||
assert context.resolve("${dict.2.foo}") == "foo"
|
||||
assert context.resolve("${dict.3.foo.0}") == "f"
|
||||
assert context.resolve("${dict[0].f}") == "f"
|
||||
assert context.resolve("${dict[1].fo}") == "fo"
|
||||
assert context.resolve("${dict[2].foo}") == "foo"
|
||||
assert context.resolve("${dict[3].foo[0]}") == "f"
|
||||
|
||||
assert context.resolve("${ dict.1.fo}${dict.3.foo.1}bar") == "foobar"
|
||||
|
||||
@@ -101,3 +101,11 @@ def test_resolve_collection():
|
||||
resolved = context.resolve(TEMPLATED_DVC_YAML_DATA)
|
||||
assert resolved == RESOLVED_DVC_YAML_DATA
|
||||
assert recurse_not_a_node(resolved)
|
||||
|
||||
|
||||
def test_resolve_unicode():
|
||||
context = Context({"नेपाली": {"चिया": ["चि", "या"]}})
|
||||
assert context.resolve_str("${नेपाली.चिया[0]}${नेपाली.चिया[1]}") == "चिया"
|
||||
assert (
|
||||
context.resolve_str("${नेपाली[चिया][0]}${नेपाली[चिया][1]}") == "चिया"
|
||||
)
|
||||
|
||||
@@ -11,7 +11,7 @@ TEMPLATED_DVC_YAML_DATA = {
|
||||
"cmd": "python script.py ${dict.foo} --out ${dict.bar}",
|
||||
"outs": ["${dict.bar}"],
|
||||
"deps": ["${dict.foo}"],
|
||||
"params": ["${list.0}", "${list.1}"],
|
||||
"params": ["${list[0]}", "${list[1]}"],
|
||||
"frozen": "${freeze}",
|
||||
},
|
||||
"stage2": {"cmd": "echo ${dict.foo} ${dict.bar}"},
|
||||
@@ -118,8 +118,8 @@ def test_set_interpolated_string():
|
||||
{
|
||||
"foo": "${dict.foo}",
|
||||
"bar": "${dict.bar}",
|
||||
"param1": "${list.0}",
|
||||
"param2": "${list.1}",
|
||||
"param1": "${list[0]}",
|
||||
"param2": "${list[1]}",
|
||||
"frozen": "${freeze}",
|
||||
"dict2": "${dict}",
|
||||
"list2": "${list}",
|
||||
|
||||
Reference in New Issue
Block a user