#NEWLINE# def test_display_blob_inline_and_binary( self ) : #NEWLINE# #INDENT# request = webapp2 . Request . blank ( '/blob/blobkey?display=inline' ) #NEWLINE# response = webapp2 . Response ( ) #NEWLINE# handler = blobstore_viewer . BlobRequestHandler ( request , response ) #NEWLINE# blob_info = self . mox . CreateMock ( blobstore . BlobInfo ) #NEWLINE# blob_info . content_type = 'application/octet-stream' #NEWLINE# blobstore . BlobInfo . get ( 'blobkey' ) . AndReturn ( blob_info ) #NEWLINE# reader = self . mox . CreateMockAnything ( ) #NEWLINE# blob_info . open ( ) . AndReturn ( reader ) #NEWLINE# reader . read ( ) . AndReturn ( 'blob bytes' ) #NEWLINE# reader . close ( ) #NEWLINE# self . mox . ReplayAll ( ) #NEWLINE# handler . get ( 'blobkey' ) #NEWLINE# self . mox . VerifyAll ( ) #NEWLINE# self . assertEqual ( 'text/plain' , response . headers . get ( 'Content-Type' ) ) #NEWLINE# self . assertEqual ( 'inline' , response . headers . get ( 'Content-Disposition' ) ) #NEWLINE# self . assertEqual ( 'blob bytes' , response . body )