From 9fce6e1989004da7ab22928e47afe78f458aa892 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Tue, 15 Sep 2026 17:09:12 +0000 Subject: [PATCH] test(pricing): let synced GovCloud Bedrock rows cite the AWS price list Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- tests/test_litellm/test_bedrock_usgov_pricing.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/test_litellm/test_bedrock_usgov_pricing.py b/tests/test_litellm/test_bedrock_usgov_pricing.py index 3dfd7350a06..4d5b27a8668 100644 --- a/tests/test_litellm/test_bedrock_usgov_pricing.py +++ b/tests/test_litellm/test_bedrock_usgov_pricing.py @@ -112,6 +112,11 @@ GOV_ROW_SOURCES = { } +BEDROCK_PRICE_LIST_URL = ( + "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json" +) + + def _non_pricing_fields(info): return {k: v for k, v in info.items() if "cost" not in k and k not in ("litellm_provider", "source")} @@ -121,8 +126,10 @@ def test_usgov_rows_keep_commercial_limits_and_capabilities(model_data, gov_key) """A gov row differs from the commercial row it mirrors only in price and provider: context limits, mode, and capability flags stay identical, so a hand-copied row cannot silently drop tool calling or shrink the context window. + The only source a gov row may cite is the AWS price list, which prices the + us-gov regions itself; a commercial doc URL copied along with the row is not. """ gov = model_data[gov_key] assert _non_pricing_fields(gov) == _non_pricing_fields(model_data[GOV_ROW_SOURCES[gov_key]]) assert "search_context_cost_per_query" not in gov - assert "source" not in gov + assert gov.get("source", BEDROCK_PRICE_LIST_URL) == BEDROCK_PRICE_LIST_URL