Пример #1
0
    def test_state_is_not_exited(self, context, trace):
        context.monitored_trace = []
        steps.state_is_not_exited(context, 'state')

        context.monitored_trace = trace
        with pytest.raises(AssertionError):
            steps.state_is_not_exited(context, 'x')
        steps.state_is_not_exited(context, 'state')
        with pytest.raises(StatechartError):
            steps.state_is_entered(context, 'unknown state')
Пример #2
0
    def test_state_is_not_active(self, context):
        context.interpreter.configuration = []

        steps.state_is_not_active(context, 'state')

        context.interpreter.configuration = ['a', 'b', 'c']
        with pytest.raises(AssertionError):
            steps.state_is_not_active(context, 'a')

        steps.state_is_not_active(context, 'state')
        with pytest.raises(StatechartError):
            steps.state_is_entered(context, 'unknown state')