mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-30 03:00:41 -04:00
test(backend): add guard test for tier multiplier enum completeness
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) <noreply@anthropic.com>
This commit is contained in:
@@ -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",
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user