def do_comparison(good_record, test_record):
 good_handle = StringIO(good_record)
 test_handle = StringIO(test_record)
 while True:
  good_line = good_handle.readline()
  test_line = test_handle.readline()
  if ((not good_line) and (not test_line)):
   break
  if (not good_line):
   raise AssertionError(('Extra info in Test: %r' % test_line))
  if (not test_line):
   raise AssertionError(('Extra info in Expected: %r' % good_line))
  test_normalized = ' '.join((x for x in test_line.split() if x))
  good_normalized = ' '.join((x for x in good_line.split() if x))
  assert (test_normalized == good_normalized), ('Expected does not match Test.\nExpect: %r\nTest:   %r\n' % (good_line, test_line))

def do_comparison ( good_record , test_record ) : good_handle = StringIO ( good_record ) test_handle = StringIO ( test_record ) while True : good_line = good_handle . readline ( ) test_line = test_handle . readline ( ) if ( ( not good_line ) and ( not test_line ) ) : break if ( not good_line ) : raise AssertionError ( ( 'Extra info in Test: %r' % test_line ) ) if ( not test_line ) : raise AssertionError ( ( 'Extra info in Expected: %r' % good_line ) ) test_normalized = ' ' . join ( ( x for x in test_line . split ( ) if x ) ) good_normalized = ' ' . join ( ( x for x in good_line . split ( ) if x ) ) assert ( test_normalized == good_normalized ) , ( 'Expected does not match Test.\nExpect: %r\nTest:   %r\n' % ( good_line , test_line ) )
compare two records to see if they are the same .