forked from claw/flaskpaste
validate MIN_ENTROPY config bounds [0, 8]
This commit is contained in:
@@ -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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user