mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-08-05 02:45:28 +00:00
Slice 2m of the route-domain reorganization (#4082/#4071, per
specs/architecture-runtime-inventory.md §6.3). Moves document_routes.py
(1810 lines) and document_helpers.py (243 lines) into routes/document/,
leaving backward-compat sys.modules shims at the old paths. Pure file
reorganization, no behavior change.
Both shims use sys.modules replacement so the `import ... as droutes` +
`droutes.SessionLocal = ...` / `monkeypatch.setattr(droutes, ...)` pattern
in multiple tests, and the `sys.modules.pop("routes.document_helpers")` +
re-import pattern in test_security_regressions.py, all reach the canonical
modules.
The canonical document_routes.py imports helpers from the canonical path
(routes.document.document_helpers), not the legacy shim.
Three source-introspection test sites repointed to the new canonical path:
- test_imap_mailbox_quoting.py
- test_model_helper_owner_scope.py
- test_vision_owner_scope.py (shared with other domains; document entry repointed)
Adds tests/test_document_routes_shim.py to pin the sys.modules shim contract
for both modules.
Verified: compileall clean; full suite 4789 passed, 3 skipped.
14 lines
596 B
Python
14 lines
596 B
Python
"""Backward-compat shim — canonical location is routes/document/document_helpers.py.
|
|
|
|
This module is replaced in ``sys.modules`` by the canonical module object so
|
|
that ``import routes.document_helpers``, ``from routes.document_helpers import
|
|
X``, and the ``sys.modules.pop("routes.document_helpers")`` + re-import
|
|
pattern used by test_security_regressions.py all operate on the *same* object.
|
|
Keeps existing import paths working after slice 2m (#4082/#4071).
|
|
"""
|
|
|
|
import sys as _sys
|
|
|
|
from routes.document import document_helpers as _canonical # noqa: F401
|
|
|
|
_sys.modules[__name__] = _canonical
|