#NEWLINE# def test_run_in_reactor_wrapper( self ) : #NEWLINE# #INDENT# '\n        in_reactor is implemented on top of run_in_reactor.\n        ' #NEWLINE# wrapped = [ False ] #NEWLINE# def fake_run_in_reactor( function ) : #NEWLINE# #INDENT# def wrapper( * args , **kwargs ) : #NEWLINE# #INDENT# wrapped [ 0 ] = True #NEWLINE# result = function ( * args , ** kwargs ) #NEWLINE# wrapped [ 0 ] = False #NEWLINE# return result #NEWLINE# #UNINDENT# return wrapper #NEWLINE# #UNINDENT# myreactor = FakeReactor ( ) #NEWLINE# c = EventLoop ( ( lambda : myreactor ) , ( lambda f , g : None ) ) #NEWLINE# c . no_setup ( ) #NEWLINE# c . run_in_reactor = fake_run_in_reactor #NEWLINE# @ c . in_reactor #NEWLINE# def func( reactor ) : #NEWLINE# #INDENT# self . assertTrue ( wrapped [ 0 ] ) #NEWLINE# return 17 #NEWLINE# #UNINDENT# result = func ( ) #NEWLINE# self . assertFalse ( wrapped [ 0 ] ) #NEWLINE# self . assertEqual ( result , 17 )