def files_contains(file1, file2, attributes=None):
 local_file = open(file1, 'U').readlines()
 history_data = open(file2, 'U').read()
 lines_diff = int(attributes.get('lines_diff', 0))
 line_diff_count = 0
 while local_file:
  contains = local_file.pop(0).rstrip('\n\r')
  if (contains not in history_data):
   line_diff_count += 1
  if (line_diff_count > lines_diff):
   raise AssertionError(("Failed to find '%s' in history data. (lines_diff=%i):\n" % (contains, lines_diff)))

def files_contains ( file1 , file2 , attributes = None ) : local_file = open ( file1 , 'U' ) . readlines ( ) history_data = open ( file2 , 'U' ) . read ( ) lines_diff = int ( attributes . get ( 'lines_diff' , 0 ) ) line_diff_count = 0 while local_file : contains = local_file . pop ( 0 ) . rstrip ( '\n\r' ) if ( contains not in history_data ) : line_diff_count += 1 if ( line_diff_count > lines_diff ) : raise AssertionError ( ( "Failed to find '%s' in history data. (lines_diff=%i):\n" % ( contains , lines_diff ) ) )
check the contents of file2 for substrings found in file1 .