예제 #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')
예제 #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')
예제 #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")