#!/usr/bin/python """ test harness for converting from .ics to .rdf $Id: fromIcalTest.py,v 1.10 2006/02/25 08:20:33 connolly Exp $ """ import os, sys SWAP=sys.argv[1] Cases = ('xml2005-ndw', 'tag-bug', 'test-created', 'TestTermin', 'geo1', 'Todos1', 'cal01', 'cal02', 'mtg', 'bus-hrs', 'gkexample', 'openingHours', 'spec01-conf3', '20030423mtg', 'ISWC-related', 'MovieInfo', 'MozexportAsCalendar', 'Chiefs', '20030115mtg', '20030122mtg', '20030205mtg', '20030212mtg', '20030226mtg', '20030312mtg', '20030326mtg', '20030409mtg', '20030410querymtg', '20030416geomtg', '20030423mtg', 'bus-hrs', 'querymeetings', ) # 'MozMulipleVcalendars', def main(): try: os.mkdir(",temp") except OSError: pass passes = 0 for case in Cases: print print "==== ", case os.system(("python fromIcal.py" + " --base %s/test/%s" + " test/%s.ics >,temp/%s.rdf") % ('http://www.w3.org/2002/12/cal', case, case, case)) fp = os.popen("python %s/cwm.py test/graphCompare.n3 --think --data " "--with test/%s.rdf ,temp/%s.rdf" % (SWAP, case, case)) for l in fp.readlines(): if ':notIncludes' in l: print l if 'Success' in l: print l passes += 1 print "=========== %d passes out of %d." % (passes, len(Cases)) if __name__ == '__main__': main()