Skip to content

Commit 129adc9

Browse files
add test for initial state dict (#3727)
1 parent 2629366 commit 129adc9

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/test_state.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,6 +1012,21 @@ def interdependent_state() -> BaseState:
10121012
return s
10131013

10141014

1015+
def test_interdependent_state_initial_dict() -> None:
1016+
s = InterdependentState()
1017+
state_name = s.get_name()
1018+
d = s.dict(initial=True)[state_name]
1019+
d.pop("router")
1020+
assert d == {
1021+
"x": 0,
1022+
"v1": 0,
1023+
"v1x2": 0,
1024+
"v2x2": 2,
1025+
"v1x2x2": 0,
1026+
"v3x2": 2,
1027+
}
1028+
1029+
10151030
def test_not_dirty_computed_var_from_var(
10161031
interdependent_state: InterdependentState,
10171032
) -> None:

0 commit comments

Comments
 (0)