def test_event_handlers(test_state):
    """Test that event handler is set correctly.

    Args:
        test_state: A state.
    """
    expected_keys = (
        "do_something",
        "set_array",
        "set_complex",
        "set_fig",
        "set_key",
        "set_mapping",
        "set_num1",
        "set_num2",
        "set_obj",
    )

    cls = type(test_state)
    assert all(key in cls.event_handlers for key in expected_keys)
Test that event handler is set correctly.

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