27 lines
1.1 KiB
Python
27 lines
1.1 KiB
Python
import unittest
|
|
import unittest.mock
|
|
|
|
from model_routing.review_choice import chosen, ReviewChoice
|
|
from model_routing import ladder
|
|
from model_routing.route import Route
|
|
from model_routing.ladder import Rung
|
|
|
|
HAIKU = Rung("claude-haiku-5-5", "low")
|
|
OPUS = Rung("claude-opus-5-5", "medium")
|
|
OPUS_MAX = Rung("claude-opus-5-5", "max")
|
|
FABLE = Rung("claude-fable-5-1", "max")
|
|
SONNET = Rung("claude-sonnet-5-5", "high")
|
|
|
|
|
|
class Chosen(unittest.TestCase):
|
|
def test_names_no_higher_rung_on_the_top_one(self):
|
|
self.assertEqual(chosen(OPUS, Route(FABLE, 3, 4, 5)).higher, {})
|
|
|
|
def test_names_the_e_plus_i_that_ends_a_replay_even_where_the_reviewers_are_on_the_top_rung(self):
|
|
with unittest.mock.patch.dict(ladder.REPLAYED, {("prose", "claude-fable-5-1"): HAIKU}):
|
|
self.assertEqual(chosen(FABLE, Route(OPUS_MAX, 3, 4, 4)), ReviewChoice(FABLE, {"prose": HAIKU}, FABLE, FABLE, {FABLE: 5}))
|
|
|
|
def test_puts_every_pass_on_the_reviewers_rung_once_an_e_plus_i_steps_a_review_up(self):
|
|
with unittest.mock.patch.dict(ladder.REPLAYED, {("prose", "claude-opus-5-5"): HAIKU}):
|
|
self.assertEqual(chosen(OPUS, Route(SONNET, 3, 2, 5)).lowered, {})
|