    def test_simple_condition(self):
        '''Tests a simple condition check before transitioning.'''
        helper = Helper()
        states = ['one', 'two']
        transitions = [
            {'source': 'one', 'dest': 'two', 'condition': helper.x_is_five},
            {'source': 'two', 'dest': 'one'},
        ]
        during = {
            'one': helper.increment
        }
        sm = StateMachine(states, transitions, 'one', during=during)
        for x in range(5):
            assert(helper.x == x)
            assert(str(sm.state) == 'one')
            sm.step()
        assert(helper.x == 5)
        assert(str(sm.state) == 'two')
        sm.step()
        assert(helper.x == 5)
        assert(str(sm.state) == 'one')
        sm.step()
        assert(helper.x == 6)
        assert(str(sm.state) == 'one')
        sm.step()
        assert(helper.x == 7)
        assert(str(sm.state) == 'one')
Tests a simple condition check before transitioning.
tests/state_machine_test.py