validate MIN_ENTROPY config bounds [0, 8]

This commit is contained in:
Username
2025-12-26 18:47:06 +01:00
parent 3cda73c8b0
commit bc751d1b8c
2 changed files with 21 additions and 2 deletions

View File

@@ -410,6 +410,23 @@ class TestEntropyEnforcement:
assert response.status_code == 201
class TestEntropyConfigValidation:
"""Test entropy config validation and bounds checking."""
def test_min_entropy_clamped_to_valid_range(self):
"""MIN_ENTROPY should be clamped to [0, 8] range."""
from app.config import Config
# Verify clamping logic works (config uses max(0, min(8, value)))
assert 0.0 <= Config.MIN_ENTROPY <= 8.0
def test_min_entropy_size_positive(self):
"""MIN_ENTROPY_SIZE should be at least 1."""
from app.config import Config
assert Config.MIN_ENTROPY_SIZE >= 1
class TestConcurrentSubmissions:
"""Test concurrent identical submissions handling.