def test(infoMap, failedList, skippedList): print " Testing Filters (1) ...", # Gzip compression doesn't always return the same exact result ! # So we just check that the first few bytes are the same helper.checkPageResult( "Filters", infoMap, code, testList, failedList, extraRequestHeader=[("Accept-Encoding", "gzip")] )
def test(infoMap, failedList, skippedList): print " Testing VirtualHostFilter (1) ...", helper.checkPageResult('VirtualHostFilter', infoMap, code, test1List, failedList, extraRequestHeader = [("X-Forwarded-Host", "site1")]) print " Testing VirtualHostFilter (2) ...", helper.checkPageResult('VirtualHostFilter', infoMap, code, test2List, failedList, extraRequestHeader = [("X-Forwarded-Host", "site2")])
def test(infoMap, failedList, skippedList): print " Testing object mapping...", helper.checkPageResult('Object mapping', infoMap, code, testList, failedList)
for version, infoMap in python2.items(): print print "Running tests for python %s..." % infoMap["exactVersionShort"] # Run tests based on tutorials for filename, myTestList in tutorialTestList: code = open("../tutorial/%s" % filename, "r").read() code = code.replace("tutorial.conf", "testsite.cfg") print " Testing tutorial %s..." % filename, # if ((version == 1 and number in ('06', '09')) or # (version == 2 and number in ('09'))): # print "skipped" # skippedList.append("Tutorial %s for python2.%s" % (number, version)) # continue helper.checkPageResult("Tutorial %s" % filename, infoMap, code, myTestList, failedList) # Running actual unittests for test in testList: exec ("import " + test) eval(test + ".test(infoMap, failedList, skippedList)") print print print "#####################################" print "#####################################" print "### TEST RESULT ###" print "#####################################" print "#####################################" if skippedList: print