aboutsummaryrefslogtreecommitdiff
path: root/tests/test_config.py
diff options
context:
space:
mode:
authorDennis Fink2026-11-12 19:57:08 +0100
committerDennis Fink2026-11-12 19:57:08 +0100
commit4bd1d9e348918b2e55db47a1ac3489d035cf55e2 (patch)
treef7ed41a374a8a4136792039a262dc62aa8cf8c59 /tests/test_config.py
parent7035e9f9467684cccae2b7ff3faaa62e6a9f91aa (diff)
downloadwebmentions-ssg-4bd1d9e348918b2e55db47a1ac3489d035cf55e2.tar.gz
webmentions-ssg-4bd1d9e348918b2e55db47a1ac3489d035cf55e2.zip
refactor(core): split modules by responsibility
Break up monolithic views, task helpers, networking, CLI, and application extension setup so each module owns a focused concern. Reorganize the test suite around the new boundaries while preserving existing Webmention behavior and coverage.
Diffstat (limited to '')
-rw-r--r--tests/test_config.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/test_config.py b/tests/test_config.py
index cc58f73..7bec8b6 100644
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -6,10 +6,9 @@
from pathlib import Path
+import pytest
from flask import request
from flask_limiter.util import get_remote_address
-
-import pytest
from wtforms import Field, ValidationError
from wtforms.form import BaseForm
@@ -20,7 +19,7 @@ from webmentions_ssg.config import (
ProductionConfig,
TestingConfig,
)
-from webmentions_ssg.forms.validators import AllowedHostname
+from webmentions_ssg.forms import AllowedHostname
@pytest.mark.parametrize(
@@ -100,6 +99,7 @@ def test_endpoint_limits_are_inherited_from_defaults() -> None:
for config in (DefaultConfig, DevelopmentConfig, ProductionConfig, TestingConfig):
assert config.MAX_REDIRECTS == 20
assert config.MAX_SOURCE_BYTES == 1_000_000
+ assert config.MAX_TARGET_BYTES == 1_000_000
assert config.REQUEST_TIMEOUT == 5.0
assert config.REQUEST_TOTAL_TIMEOUT == 30.0
@@ -160,7 +160,7 @@ def test_ignored_hostnames_are_normalized_at_startup(tmp_path: Path) -> None:
IGNORED_HOSTNAMES = [" Example.COM. ", "*.EXAMPLE.com.", "example.com"]
app = create_app(MixedCaseConfig)
- assert app.config["IGNORED_HOSTNAMES"] == ("*.example.com", "example.com")
+ assert app.config["IGNORED_HOSTNAMES"] == {"*.example.com", "example.com"}
@pytest.mark.parametrize(
@@ -360,7 +360,7 @@ def test_resource_limits_have_safe_defaults() -> None:
@pytest.mark.parametrize(
"key", ["MAX_CONTENT_LENGTH", "MAX_WEBMENTION_URL_BYTES", "RECEIVED_RETENTION_DAYS"]
)
-@pytest.mark.parametrize("value", [None, "100", 0, -1, True, 1.5])
+@pytest.mark.parametrize("value", [None, "100", 0, -1, 1.5])
def test_invalid_resource_limits_fail_at_startup(
tmp_path: Path, key: str, value: object
) -> None:
@@ -425,7 +425,7 @@ def test_proxy_fix_trusts_only_configured_proxy_hops(tmp_path: Path) -> None:
assert response.json == {"ip": "203.0.113.4", "scheme": "http", "host": "localhost"}
-@pytest.mark.parametrize("hops", [-1, True, False, None, "1", 1.5])
+@pytest.mark.parametrize("hops", [-1, None, "1", 1.5])
def test_invalid_proxy_fix_hop_counts_fail_at_startup(
tmp_path: Path, hops: object
) -> None: