sh2/d2ypp2/tests/test_live_console_status_ui.py
eric 9888f1daad Harden YouTube unmanned live stack and hide advanced console panels.
Fix Pro config SSOT, event FSM, FFmpeg error tiers, relay heartbeat, and ingest auth while keeping relay snapshot, quality guard, and event hub hidden in the UI.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-23 06:31:31 -05:00

46 lines
2.2 KiB
Python

from pathlib import Path
def test_live_log_card_does_not_treat_process_online_as_pushing() -> None:
source = Path("web-console/components/live-product/LiveProcessLiveLogCard.tsx").read_text(encoding="utf-8")
assert "const onlineNow" not in source
assert "live: pushingNow || onlineNow" not in source
assert "!!monitorRow?.is_pushing" not in source
assert "pushingNow || monitorRow?.ffmpeg_active" not in source
assert "live: pushingNow," in source
def test_youtube_pro_lane_metrics_do_not_treat_process_online_as_live() -> None:
source = Path("web-console/components/live-product/LiveYoutubeUnmannedView.tsx").read_text(encoding="utf-8")
assert "live: laneLiveMetrics.live || rowOnline || isLivePushingRow(row)" not in source
assert "live: laneLiveMetrics.live || isLivePushingRow(row)" in source
assert '(business === "source_stalled" && !!row?.ffmpeg_active)' not in source
assert 'if (pm2StatusOnline(row?.process_status)) return "bg-zinc-500/15 text-zinc-200 ring-zinc-500/25";' in source
def test_ffmpeg_metrics_live_flag_only_uses_is_pushing() -> None:
source = Path("web-console/lib/ffmpegMetrics.ts").read_text(encoding="utf-8")
assert "const live = !!(row?.is_pushing || row?.ffmpeg_active);" not in source
assert "const live = !!row?.is_pushing;" in source
def test_youtube_advanced_panels_hidden_by_default() -> None:
source = Path("web-console/components/live-product/LiveYoutubeUnmannedView.tsx").read_text(encoding="utf-8")
assert "const HIDE_YOUTUBE_RELAY_SNAPSHOT = true;" in source
assert "const HIDE_YOUTUBE_QUALITY_GUARD = true;" in source
assert "const HIDE_YOUTUBE_LIVE_EVENT_HUB = true;" in source
assert "{!HIDE_YOUTUBE_QUALITY_GUARD ? qualityGuardPanel : null}" in source
def test_host04_patch_keeps_neko_proxy_separate_from_push_node() -> None:
source = Path("tools/remote_patch_host04.py").read_text(encoding="utf-8")
assert 'SHELLCRASH_PUSH_NODE = "1d2da142-singbox_tuic5"' in source
assert 'NEKO_PROXY_NODE = "proxycheap"' in source
assert '"SHELLCRASH_NEKO_PROXY_NODE": NEKO_PROXY_NODE' in source
assert 'data=json.dumps({"name": SHELLCRASH_PUSH_NODE}).encode()' in source