#NEWLINE# def assertFileContents( self , expected , filename ) : #NEWLINE# #INDENT# if filename . endswith ( '.gz' ) : #NEWLINE# #INDENT# actual = gzip . open ( filename ) . read ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# actual = file ( filename ) . read ( ) #NEWLINE# #UNINDENT# self . assertEquals ( expected , actual )