def represent_result(info, tid): if not end_tags(info): return "PARTIAL RESULT" _stat = test_summation(info["test_output"], tid)["status"] if _stat < WARNING or _stat > CRITICAL: text = "PASSED" elif _stat == WARNING: text = "WARNING" else: text = "FAILED" warnings = [] for item in info["test_output"]: if isinstance(item, tuple): continue elif item["status"] == WARNING: try: warnings.append(item["message"]) except KeyError: pass if text == "PASSED": try: text = "UNKNOWN - %s" % info["node"].kwargs["result"] except KeyError: pass if warnings: text = "%s\nWarnings:\n%s" % (text, "\n".join(warnings)) return text
def opresult(environ, start_response, conv, session): if session["node"].complete: _sum = test_summation(conv, session["testid"]) session["node"].state = _sum["status"] else: session["node"].state = INCOMPLETE return flow_list(environ, start_response, session)
def evaluate(session): try: if session["node"].complete: _info = session["test_info"][session["testid"]] if end_tags(_info): _sum = test_summation(_info["test_output"], session["testid"]) session["node"].state = _sum["status"] else: session["node"].state = INCOMPLETE else: session["node"].state = INCOMPLETE except (AttributeError, KeyError): pass