#NEWLINE# def run_request( self , method , headers , path , query , body , expected_status , expected_headers , expected_content ) : #NEWLINE# #INDENT# environ = { #NEWLINE# #INDENT# 'HTTP_HOST' : self . _host , #NEWLINE# 'REQUEST_METHOD' : method , #NEWLINE# 'PATH_INFO' : path , #NEWLINE# 'QUERY_STRING' : query , #NEWLINE# 'wsgi.url_scheme' : 'http' , #NEWLINE# 'wsgi.input' : cStringIO . StringIO ( body ) , #NEWLINE# #UNINDENT# } #NEWLINE# for ( k , v ) in headers . iteritems ( ) : #NEWLINE# #INDENT# environ [ ( 'HTTP_%s' % k . upper ( ) ) ] = v #NEWLINE# #UNINDENT# self . mox . ReplayAll ( ) #NEWLINE# self . assertResponse ( expected_status , expected_headers , expected_content , self . app , environ ) #NEWLINE# self . mox . VerifyAll ( )