#NEWLINE# def test_expose_request_keyword( self ) : #NEWLINE# #INDENT# def echo( x ) : #NEWLINE# #INDENT# return x #NEWLINE# #UNINDENT# def exposed_auth( request , username , password ) : #NEWLINE# #INDENT# return self . _auth ( username , password ) #NEWLINE# #UNINDENT# echo = gateway . authenticate ( echo , exposed_auth , expose_request = True ) #NEWLINE# gw = gateway . BaseGateway ( { #NEWLINE# #INDENT# 'echo' : echo , #NEWLINE# #UNINDENT# } ) #NEWLINE# envelope = remoting . Envelope ( ) #NEWLINE# request = remoting . Request ( 'echo' , body = [ 'spam' ] ) #NEWLINE# envelope . headers [ 'Credentials' ] = dict ( userid = 'fred' , password = 'wilma' ) #NEWLINE# envelope [ '/1' ] = request #NEWLINE# processor = gw . getProcessor ( request ) #NEWLINE# response = processor ( request ) #NEWLINE# self . assertEqual ( response . status , remoting . STATUS_OK ) #NEWLINE# self . assertEqual ( response . body , 'spam' )