#NEWLINE# def assertFileHandleBehaviorsMatch( self , path , mode , data ) : #NEWLINE# #INDENT# path = Sep ( path ) #NEWLINE# write_method_names = [ 'write' , 'writelines' ] #NEWLINE# read_method_names = [ 'read' , 'readlines' ] #NEWLINE# other_method_names = [ 'truncate' , 'flush' , 'close' ] #NEWLINE# differences = [ ] #NEWLINE# for method_name in write_method_names : #NEWLINE# #INDENT# diff = self . DiffOpenMethodBehavior ( method_name , path , mode , data ) #NEWLINE# if diff : #NEWLINE# #INDENT# differences . append ( diff ) #NEWLINE# #UNINDENT# #UNINDENT# for method_name in ( method_name + other_method_names ) : #NEWLINE# #INDENT# diff = self . DiffOpenMethodBehavior ( method_name , path , mode , ( ) ) #NEWLINE# if diff : #NEWLINE# #INDENT# differences . append ( diff ) #NEWLINE# #UNINDENT# #UNINDENT# if differences : #NEWLINE# #INDENT# self . fail ( ( 'Behaviors do not match for %s:\n    %s' % ( path , '\n    ' . join ( differences ) ) ) )