"""Tests for SSE dashboard streaming endpoint.""" from fusionagi.api.routes.dashboard_sse import _get_system_snapshot def test_system_snapshot_format(): """Snapshot should contain all expected fields.""" snapshot = _get_system_snapshot() assert snapshot["status"] == "healthy" assert "uptime_seconds" in snapshot assert "active_agents" in snapshot assert "memory_usage_mb" in snapshot assert "timestamp" in snapshot assert isinstance(snapshot["timestamp"], float) def test_system_snapshot_memory(): """Memory usage should be a positive number.""" snapshot = _get_system_snapshot() assert snapshot["memory_usage_mb"] > 0