test_gateway_runtime_health.py
1 from hermes_cli.gateway import _runtime_health_lines 2 3 4 def test_runtime_health_lines_include_fatal_platform_and_startup_reason(monkeypatch): 5 monkeypatch.setattr( 6 "gateway.status.read_runtime_status", 7 lambda: { 8 "gateway_state": "startup_failed", 9 "exit_reason": "telegram conflict", 10 "platforms": { 11 "telegram": { 12 "state": "fatal", 13 "error_message": "another poller is active", 14 } 15 }, 16 }, 17 ) 18 19 lines = _runtime_health_lines() 20 21 assert "⚠ telegram: another poller is active" in lines 22 assert "⚠ Last startup issue: telegram conflict" in lines