Mirror test layout, domcontentloaded waits, backup DB writes outside threads

This commit is contained in:
2026-10-05 09:41:22 +02:00
parent 8f6c5be314
commit 622795c9a0
46 changed files with 296 additions and 241 deletions
+1
View File
@@ -0,0 +1 @@
# retoor <retoor@molodetz.nl>
@@ -3,20 +3,9 @@ import io
from pypdf import PdfWriter
from molodetz.cli import build_parser
from molodetz.cli.commands import read_source
def test_parser_groups():
parser = build_parser()
args = parser.parse_args(["posts", "import", "notitie.md", "--topic", "standaard"])
assert args.topic == "standaard" and args.path == "notitie.md"
args = parser.parse_args(["system", "prune", "--dry-run"])
assert args.dry_run is True
args = parser.parse_args(["role", "set", "retoor", "Admin"])
assert args.role == "Admin"
def test_read_markdown(tmp_path):
path = tmp_path / "x.md"
path.write_text("# Kop\n\nTekst", encoding="utf-8")
+12
View File
@@ -0,0 +1,12 @@
# retoor <retoor@molodetz.nl>
from molodetz.cli.main import build_parser
def test_parser_groups():
parser = build_parser()
args = parser.parse_args(["posts", "import", "notitie.md", "--topic", "standaard"])
assert args.topic == "standaard" and args.path == "notitie.md"
args = parser.parse_args(["system", "prune", "--dry-run"])
assert args.dry_run is True
args = parser.parse_args(["role", "set", "retoor", "Admin"])
assert args.role == "Admin"
+8
View File
@@ -0,0 +1,8 @@
# retoor <retoor@molodetz.nl>
from molodetz.constants import REPORTABLE_TARGETS, SOFT_DELETE_TABLES, UNREPORTABLE_TABLES
def test_soft_delete_tables_partition():
tables = set(SOFT_DELETE_TABLES)
assert tables == set(REPORTABLE_TARGETS) | set(UNREPORTABLE_TABLES)
assert not set(REPORTABLE_TARGETS) & set(UNREPORTABLE_TABLES)
+1
View File
@@ -0,0 +1 @@
# retoor <retoor@molodetz.nl>
+1
View File
@@ -0,0 +1 @@
# retoor <retoor@molodetz.nl>
@@ -1,15 +1,8 @@
# retoor <retoor@molodetz.nl>
from molodetz.constants import REPORTABLE_TARGETS, SOFT_DELETE_TABLES, UNREPORTABLE_TABLES
from molodetz.docs_api import all_endpoints
from molodetz.docs_api.registry import TARGET_TYPES
def test_soft_delete_tables_partition():
tables = set(SOFT_DELETE_TABLES)
assert tables == set(REPORTABLE_TARGETS) | set(UNREPORTABLE_TABLES)
assert not set(REPORTABLE_TARGETS) & set(UNREPORTABLE_TABLES)
def test_documented_endpoints_are_unique():
keys = [(item["method"], item["path"]) for item in all_endpoints()]
assert len(keys) == len(set(keys))
@@ -25,10 +18,3 @@ def test_documented_endpoints_exist_in_app():
def test_target_types_known():
assert set(TARGET_TYPES) == {"post", "join_request", "user"}
def test_no_oauth_redirect_route():
from molodetz.main import app
assert "/docs/oauth2-redirect" not in app.openapi()["paths"]
assert app.swagger_ui_oauth2_redirect_url is None
+12
View File
@@ -0,0 +1,12 @@
# retoor <retoor@molodetz.nl>
from molodetz.main import app
def test_no_oauth_redirect_route():
assert "/docs/oauth2-redirect" not in app.openapi()["paths"]
assert app.swagger_ui_oauth2_redirect_url is None
def test_framework_docs_moved():
assert app.docs_url == "/swagger"
assert app.redoc_url is None
+1
View File
@@ -0,0 +1 @@
# retoor <retoor@molodetz.nl>