From 938cf9ea5fc09b7cf4821e6a6833b009be485927 Mon Sep 17 00:00:00 2001 From: Nicholas Tindle Date: Fri, 24 Apr 2026 14:17:06 -0500 Subject: [PATCH] test(backend): add guard test for tier multiplier enum completeness MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ensures every SubscriptionTier has an entry in _DEFAULT_TIER_MULTIPLIERS. Matches the existing storage limit guard — both fail immediately if someone adds a new tier without updating the mappings. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../backend/backend/copilot/rate_limit_test.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/autogpt_platform/backend/backend/copilot/rate_limit_test.py b/autogpt_platform/backend/backend/copilot/rate_limit_test.py index 58d8b5f9ab..5525398d94 100644 --- a/autogpt_platform/backend/backend/copilot/rate_limit_test.py +++ b/autogpt_platform/backend/backend/copilot/rate_limit_test.py @@ -1608,6 +1608,15 @@ class TestWorkspaceStorageLimits: ) assert TIER_WORKSPACE_STORAGE_MB[tier] > 0 + def test_every_subscription_tier_has_rate_limit_multiplier(self): + """Adding a new SubscriptionTier without a rate limit multiplier should fail.""" + for tier in SubscriptionTier: + assert tier in _DEFAULT_TIER_MULTIPLIERS, ( + f"SubscriptionTier.{tier.name} has no entry in " + f"_DEFAULT_TIER_MULTIPLIERS — add one" + ) + assert _DEFAULT_TIER_MULTIPLIERS[tier] > 0 + @pytest.mark.parametrize( "tier,expected_mb", [