app_config: reject non-object config.json sections with AppConfigError

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VPNF37MP9Kuv62B1VBrZ1b
This commit is contained in:
Harwinder Sekhon
2026-07-21 12:54:46 -04:00
parent 2c070fb9b3
commit 7455fcaa6c
2 changed files with 20 additions and 0 deletions
+16
View File
@@ -2661,6 +2661,22 @@ def _():
assert telegram_channel_id(app) == ""
@test("app_config: non-object sections raise AppConfigError")
def _():
for payload in (
{"telegram": None},
{"telegram": "oops"},
{"scanning": 5},
{"pairs": ["oops"]},
{"pairs": {"XAU/USD": ["blocked_hours_utc"]}},
):
try:
load_app_config(_write_json(payload))
assert False, f"should have raised for {payload}"
except AppConfigError:
pass
# ══════════════════════════════════════════════════════════════════════
# SUMMARY
# ══════════════════════════════════════════════════════════════════════