Improve log upload handling
This commit is contained in:
15
tests/test_config.py
Normal file
15
tests/test_config.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from app.config import _get_max_content_length
|
||||
|
||||
|
||||
def test_max_upload_size_mb_environment_variable(monkeypatch):
|
||||
monkeypatch.setenv("MAX_UPLOAD_SIZE_MB", "42")
|
||||
monkeypatch.delenv("MAX_CONTENT_LENGTH", raising=False)
|
||||
|
||||
assert _get_max_content_length() == 42 * 1024 * 1024
|
||||
|
||||
|
||||
def test_max_content_length_environment_variable_is_supported(monkeypatch):
|
||||
monkeypatch.delenv("MAX_UPLOAD_SIZE_MB", raising=False)
|
||||
monkeypatch.setenv("MAX_CONTENT_LENGTH", "2048")
|
||||
|
||||
assert _get_max_content_length() == 2048
|
||||
Reference in New Issue
Block a user