mirror of
https://github.com/Routstr/routstr-core.git
synced 2026-10-05 12:28:22 +00:00
fix tests last time
This commit is contained in:
@@ -35,7 +35,12 @@ def test_get_max_cost_for_model_disabled() -> None:
|
||||
|
||||
|
||||
def test_get_max_cost_for_model_tolerance() -> None:
|
||||
with patch("routstr.payment.helpers.MODELS", []):
|
||||
with patch("routstr.payment.helpers.COST_PER_REQUEST", 100):
|
||||
cost = get_max_cost_for_model("any-model", tolerance_percentage=10)
|
||||
assert cost == 90
|
||||
mock_model = Mock()
|
||||
mock_model.id = "gpt-4"
|
||||
mock_model.sats_pricing = Mock()
|
||||
mock_model.sats_pricing.max_cost = 500
|
||||
|
||||
with patch("routstr.payment.helpers.MODELS", [mock_model]):
|
||||
with patch("routstr.payment.helpers.MODEL_BASED_PRICING", True):
|
||||
cost = get_max_cost_for_model("gpt-4", tolerance_percentage=10)
|
||||
assert cost == 450000 # 500 sats * 1000 * 0.9 = 450000
|
||||
|
||||
Reference in New Issue
Block a user