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:
+16
@@ -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
|
||||
# ══════════════════════════════════════════════════════════════════════
|
||||
|
||||
Reference in New Issue
Block a user