feat(s52): export Notifier public contract + sync extending.md B11

This commit is contained in:
Kjell Tore Guttormsen 2026-07-16 19:53:57 +02:00
commit b84f4d46bb
3 changed files with 48 additions and 2 deletions

View file

@ -129,3 +129,23 @@ def test_config_fail_fast() -> None:
notifier = build_notifier(webhook_cfg, allow_egress=True)
assert isinstance(notifier, WebhookNotifier)
def test_public_contract_exported() -> None:
"""The declared B11 contract is public authoring API: importable from the package top and
listed in ``__all__`` (the brief-permitted export path run.py's seam stays byte-intact)."""
import portfolio_optimiser
exported = (
"Notifier",
"ConsoleNotifier",
"FileNotifier",
"WebhookNotifier",
"build_notifier",
"NotifierConfig",
"NotifyError",
"NotifyRefused",
)
for name in exported:
assert name in portfolio_optimiser.__all__, f"{name} missing from __all__"
assert hasattr(portfolio_optimiser, name), f"{name} not importable from package top"