fix tests last time

This commit is contained in:
Shroominic
2025-08-23 17:02:58 -03:00
parent 9a6d976ee5
commit b478f29ee7
+9 -4
View File
@@ -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