from route_policy import route_answer
cases = [(dict(choice="quote",confidence=.85),dict(action="route",label="quote")),
(dict(choice="schedule",confidence=.99),dict(action="route",label="schedule")),
(dict(choice="complaint",confidence=.849),dict(action="review",reason="uncertain-or-other")),
(dict(choice="other",confidence=1),dict(action="review",reason="uncertain-or-other"))]
for x in [None,{},dict(choice="unknown",confidence=1),dict(choice="quote"),dict(choice="quote",confidence="0.9"),dict(choice="quote",confidence=float("nan")),dict(choice="quote",confidence=-.1),dict(choice="quote",confidence=1.1)]:
    cases.append((x,dict(action="review",reason="invalid-answer")))
for x,y in cases: assert route_answer(x)==y
for threshold in [-1,2,float("nan")]:
    try: route_answer(None,threshold)
    except ValueError: pass
    else: raise AssertionError("invalid threshold accepted")
print("12 Python routing fixtures and 3 invalid-threshold checks passed. No model API was called.")
