#NEWLINE# def test_static_existing_file( self ) : #NEWLINE# #INDENT# relative_url = '/_ah/api/static/proxy.html' #NEWLINE# discovery_api = self . mox . CreateMock ( discovery_api_proxy . DiscoveryApiProxy ) #NEWLINE# self . mox . StubOutWithMock ( discovery_api_proxy , 'DiscoveryApiProxy' ) #NEWLINE# discovery_api_proxy . DiscoveryApiProxy ( ) . AndReturn ( discovery_api ) #NEWLINE# static_response = self . mox . CreateMock ( httplib . HTTPResponse ) #NEWLINE# static_response . status = 200 #NEWLINE# static_response . reason = 'OK' #NEWLINE# static_response . getheader ( 'Content-Type' ) . AndReturn ( 'test/type' ) #NEWLINE# test_body = 'test body' #NEWLINE# discovery_api . get_static_file ( relative_url ) . AndReturn ( ( static_response , test_body ) ) #NEWLINE# request = test_utils . build_request ( relative_url ) #NEWLINE# self . mox . ReplayAll ( ) #NEWLINE# response = self . server . dispatch ( request , self . start_response ) #NEWLINE# self . mox . VerifyAll ( ) #NEWLINE# response = '' . join ( response ) #NEWLINE# self . assert_http_match ( response , '200 OK' , [ ( 'Content-Length' , ( '%d' % len ( test_body ) ) ) , ( 'Content-Type' , 'test/type' ) ] , test_body )