def check_roundtrip(course_dir):
 print '====== Roundtrip import ======='
 (ok, course) = import_with_checks(course_dir)
 if (not ok):
  raise Exception('Roundtrip import failed!')
 print '====== Roundtrip export ======='
 export_dir = (course_dir + '.rt')
 export(course, export_dir)
 print '======== Roundtrip diff: ========='
 sys.stdout.flush()
 os.system('diff -r {0} {1}'.format(course_dir, export_dir))
 print '======== ideally there is no diff above this ======='

def check_roundtrip ( course_dir ) : print '====== Roundtrip import =======' ( ok , course ) = import_with_checks ( course_dir ) if ( not ok ) : raise Exception ( 'Roundtrip import failed!' ) print '====== Roundtrip export =======' export_dir = ( course_dir + '.rt' ) export ( course , export_dir ) print '======== Roundtrip diff: =========' sys . stdout . flush ( ) os . system ( 'diff -r {0} {1}' . format ( course_dir , export_dir ) ) print '======== ideally there is no diff above this ======='
check that import->export leaves the course the same .