def METHOD_NAME(sm):
    for i in range(len(EVENT_NAMES)):
        sm.state = DONE_STATE
        sm.on_error = ErrorHandler()
        if i == SEND_MOVE_EVENT:
            with pytest.raises(AssertionError):
                sm.handle(i)
            assert sm.on_error.msg is None
        elif i in [SEND_OUTCOME_EVENT, RECEIVE_OUTCOME_EVENT]:
            # should be ignored
            sm.handle(i)
            assert sm.on_error.msg is None
        else: #i == RECEIVE_MOVE_EVENT:
            sm.handle(i)
            assert bool(sm.on_error.msg)