    def test_correct_state_actions(self):
        '''
        Tests that durings, on_enters, and on_exits are called correctly and
        don't interfere with one another.
        '''
        helper = Helper2()
        states = ['one', 'two']
        transitions = [
            {'source': 'one', 'dest': 'two', 'condition': helper.x_at_least_two},
            {'source': 'two', 'dest': 'one'}
        ]
        during = {
            'one': helper.increment_x
        }
        on_enter = {
            'one': helper.increment_y
        }
        on_exit = {
            'one': helper.increment_z
        }
        sm = StateMachine(states, transitions, 'one', during=during, on_enter=on_enter,
                          on_exit=on_exit)
        sm.step()
        assert(helper.x == 1)
        assert(helper.y == 0)
        assert(helper.z == 0)
        sm.step()
        assert(helper.x == 2)
        assert(helper.y == 0)
        assert(helper.z == 10)
        sm.step()
        assert(helper.x == 2)
        assert(helper.y == 5)
        assert(helper.z == 10)
Tests that durings, on_enters, and on_exits are called correctly and
don't interfere with one another.
tests/state_machine_test.py