#NEWLINE# def test_upload_file_auto_syntax( self ) : #NEWLINE# #INDENT# 'Upload any file, expect a 200 and auto mime type' #NEWLINE# fn = os . path . join ( util . TEST_DIR , 'pasttle.ini' ) #NEWLINE# ct = 'text/x-ini' #NEWLINE# fh = open ( fn , 'rb' ) #NEWLINE# text = fh . read ( ) #NEWLINE# fh . close ( ) #NEWLINE# rsp = self . app . post ( '/post' , { #NEWLINE# #INDENT# 'upload' : text , #NEWLINE# 'filename' : fn , #NEWLINE# #UNINDENT# } ) #NEWLINE# assert ( rsp . status == '200 OK' ) #NEWLINE# url = urlparse . urlparse ( rsp . body ) #NEWLINE# rsp = self . app . get ( '/raw{0}' . format ( url . path . decode ( ) ) ) #NEWLINE# assert ( rsp . status == '200 OK' ) #NEWLINE# assert ( rsp . body == text ) #NEWLINE# assert ( rsp . content_type == ct )