def getSortedInjectionTests():
 retVal = copy.deepcopy(conf.tests)
 def priorityFunction(test):
  retVal = SORT_ORDER.FIRST
  if (test.stype == PAYLOAD.TECHNIQUE.UNION):
   retVal = SORT_ORDER.LAST
  elif (('details' in test) and ('dbms' in test.details)):
   if intersect(test.details.dbms, Backend.getIdentifiedDbms()):
    retVal = SORT_ORDER.SECOND
   else:
    retVal = SORT_ORDER.THIRD
  return retVal
 if Backend.getIdentifiedDbms():
  retVal = sorted(retVal, key=priorityFunction)
 return retVal

def getSortedInjectionTests ( ) : retVal = copy . deepcopy ( conf . tests ) def priorityFunction ( test ) : retVal = SORT_ORDER . FIRST if ( test . stype == PAYLOAD . TECHNIQUE . UNION ) : retVal = SORT_ORDER . LAST elif ( ( 'details' in test ) and ( 'dbms' in test . details ) ) : if intersect ( test . details . dbms , Backend . getIdentifiedDbms ( ) ) : retVal = SORT_ORDER . SECOND else : retVal = SORT_ORDER . THIRD return retVal if Backend . getIdentifiedDbms ( ) : retVal = sorted ( retVal , key = priorityFunction ) return retVal
returns prioritized test list by eventually detected dbms from error messages .