#NEWLINE# def testGetDeflateFailure( self ) : #NEWLINE# #INDENT# self . http . force_exception_to_status_code = False #NEWLINE# uri = urllib . parse . urljoin ( base , 'deflate/failed-compression.asis' ) #NEWLINE# try : #NEWLINE# #INDENT# ( response , content ) = self . http . request ( uri , 'GET' ) #NEWLINE# self . fail ( 'Should never reach here' ) #NEWLINE# #UNINDENT# except httplib2 . FailedToDecompressContent : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# except Exception : #NEWLINE# #INDENT# self . fail ( 'Threw wrong kind of exception' ) #NEWLINE# #UNINDENT# self . http . force_exception_to_status_code = True #NEWLINE# ( response , content ) = self . http . request ( self , 'GET' ) #NEWLINE# self . assertEqual ( response . status , 500 ) #NEWLINE# self . assertTrue ( response . reason . startswith ( 'Content purported' ) )