def test_dict(test_state: TestState):
    """Test that the dict representation of a state is correct.

    Args:
        test_state: A state.
    """
    substates = {
        test_state.get_full_name(),
        ChildState.get_full_name(),
        GrandchildState.get_full_name(),
        ChildState2.get_full_name(),
        GrandchildState2.get_full_name(),
        ChildState3.get_full_name(),
        GrandchildState3.get_full_name(),
    }
    test_state_dict = test_state.dict()
    assert set(test_state_dict) == substates
    assert set(test_state_dict[test_state.get_name()]) == set(test_state.vars)
    assert set(test_state.dict(include_computed=False)[test_state.get_name()]) == set(
        test_state.base_vars
    )
Test that the dict representation of a state is correct.

    Args:
        test_state: A state.
    
tests/units/test_state.py