Skip to content

Commit eb17a4d

Browse files
author
Jeffrey Wigger
committed
added tests for single list item splitter
1 parent 140dd30 commit eb17a4d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

pydra/engine/tests/test_helpers_state.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,12 @@ def __init__(
3131
"splitter, keys_exp, groups_exp, grstack_exp",
3232
[
3333
("a", ["a"], {"a": 0}, [[0]]),
34+
(["a"], ["a"], {"a": 0}, [[0]]),
35+
(("a",), ["a"], {"a": 0}, [[0]]),
3436
(("a", "b"), ["a", "b"], {"a": 0, "b": 0}, [[0]]),
3537
(["a", "b"], ["a", "b"], {"a": 0, "b": 1}, [[0, 1]]),
38+
([["a", "b"]], ["a", "b"], {"a": 0, "b": 1}, [[0, 1]]),
39+
((["a", "b"],), ["a", "b"], {"a": 0, "b": 1}, [[0, 1]]),
3640
((["a", "b"], "c"), ["a", "b", "c"], {"a": 0, "b": 1, "c": [0, 1]}, [[0, 1]]),
3741
([("a", "b"), "c"], ["a", "b", "c"], {"a": 0, "b": 0, "c": 1}, [[0, 1]]),
3842
([["a", "b"], "c"], ["a", "b", "c"], {"a": 0, "b": 1, "c": 2}, [[0, 1, 2]]),
@@ -58,6 +62,8 @@ def test_splits_groups(splitter, keys_exp, groups_exp, grstack_exp):
5862
"keys_final_exp, groups_final_exp, grstack_final_exp",
5963
[
6064
("a", ["a"], ["a"], [], {}, []),
65+
(["a"], ["a"], ["a"], [], {}, []),
66+
(("a",), ["a"], ["a"], [], {}, []),
6167
(("a", "b"), ["a"], ["a", "b"], [], {}, [[]]),
6268
(("a", "b"), ["b"], ["a", "b"], [], {}, [[]]),
6369
(["a", "b"], ["b"], ["b"], ["a"], {"a": 0}, [[0]]),
@@ -69,6 +75,8 @@ def test_splits_groups(splitter, keys_exp, groups_exp, grstack_exp):
6975
([("a", "b"), "c"], ["a"], ["a", "b"], ["c"], {"c": 0}, [[0]]),
7076
([("a", "b"), "c"], ["b"], ["a", "b"], ["c"], {"c": 0}, [[0]]),
7177
([("a", "b"), "c"], ["c"], ["c"], ["a", "b"], {"a": 0, "b": 0}, [[0]]),
78+
([[("a", "b"), "c"]], ["c"], ["c"], ["a", "b"], {"a": 0, "b": 0}, [[0]]),
79+
(([("a", "b"), "c"],), ["c"], ["c"], ["a", "b"], {"a": 0, "b": 0}, [[0]]),
7280
],
7381
)
7482
def test_splits_groups_comb(
@@ -94,6 +102,8 @@ def test_splits_groups_comb(
94102
"splitter, cont_dim, values, keys, splits",
95103
[
96104
("a", None, [(0,), (1,)], ["a"], [{"a": 1}, {"a": 2}]),
105+
(["a"], None, [(0,), (1,)], ["a"], [{"a": 1}, {"a": 2}]),
106+
(("a",), None, [(0,), (1,)], ["a"], [{"a": 1}, {"a": 2}]),
97107
(
98108
("a", "v"),
99109
None,
@@ -468,6 +478,8 @@ def test_splits_2(splitter_rpn, inner_inputs, values, keys, splits):
468478
(["a", ("b", ["c", "d"])], ["a", "b", "c", "d", "*", ".", "*"]),
469479
((["a", "b"], "c"), ["a", "b", "*", "c", "."]),
470480
((["a", "b"], ["c", "d"]), ["a", "b", "*", "c", "d", "*", "."]),
481+
(([["a", "b"]], ["c", "d"]), ["a", "b", "*", "c", "d", "*", "."]),
482+
(((["a", "b"],), ["c", "d"]), ["a", "b", "*", "c", "d", "*", "."]),
471483
([("a", "b"), ("c", "d")], ["a", "b", ".", "c", "d", ".", "*"]),
472484
],
473485
)

0 commit comments

Comments
 (0)