Example #1
0
def test_state_callback_decorator(state_globals):
    callback = Mock()

    @states.state_callback
    def foo_bar():
        pass

    states.add_state_callback(callback)

    foo_bar()

    assert callback.call_args == call('FOO', 'bar')
Example #2
0
def test_state_callback_decorator(state_globals):
    callback = Mock()

    @states.state_callback
    def foo_bar():
        pass

    states.add_state_callback(callback)

    foo_bar()

    assert callback.call_args == call('FOO', 'bar')
Example #3
0
def test_state_callback_decorator(state_globals):
    callback = Mock()

    @states.state_callback
    def foo_bar(dummy):
        pass

    states.add_state_callback(callback)

    foo_bar(0)

    assert callback.call_args == call("FOO", "bar")