def test_custom_wrapper(self): def alt(function, **_kwargs): return function w = receiver(int, str, wrapper=alt)(foo) assert w == foo assert not hasattr(w, '_receiver_of')
def test_bad_args(self): with nose.tools.assert_raises(TypeError): #@UndefinedVariable _w = receiver(int, str, async=True)(foo)
def test_default(self): w = receiver(int, str)(foo) assert w._receiver_of == (int, str) assert w._filter == None assert w(None) == 1