#NEWLINE# def testAsyncRequest( self ) : #NEWLINE# #INDENT# 'Send async register request.' #NEWLINE# ident_dict = { #NEWLINE# #INDENT# 'key' : 'Email:andy@emailscrubbed.com' , #NEWLINE# 'authority' : 'FakeViewfinder' , #NEWLINE# #UNINDENT# } #NEWLINE# auth_info_dict = { #NEWLINE# #INDENT# 'identity' : ident_dict [ 'key' ] , #NEWLINE# #UNINDENT# } #NEWLINE# url = self . _tester . GetUrl ( '/link/fakeviewfinder' ) #NEWLINE# request_dict = _CreateRegisterRequest ( self . _mobile_device_dict , auth_info_dict , synchronous = False ) #NEWLINE# response = _SendAuthRequest ( self . _tester , url , 'POST' , request_dict = request_dict , user_cookie = self . _cookie ) #NEWLINE# response_dict = json . loads ( response . body ) #NEWLINE# self . _validate = False #NEWLINE# while True : #NEWLINE# #INDENT# notification = self . _RunAsync ( Notification . QueryLast , response_dict . _client , response_dict [ 'user_id' ] ) #NEWLINE# if ( notification . name == 'fetch_contacts' ) : #NEWLINE# #INDENT# self . assertEqual ( notification . op_id , response_dict [ 'headers' ] [ 'op_id' ] ) #NEWLINE# break #NEWLINE# #UNINDENT# self . _RunAsync ( IOLoop . current ( ) . add_timeout , ( time . time ( ) + 0.1 ) )