Files
manual_slop/tests/test_gui_diagnostics.py

23 lines
839 B
Python

import sys
import os
from typing import Any
# Ensure project root is in path for imports
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src")))
def test_diagnostics_panel_initialization(app_instance: Any) -> None:
assert "Diagnostics" in app_instance.show_windows
assert "frame_time" in app_instance.perf_history
assert len(app_instance.perf_history["frame_time"]) == 100
def test_diagnostics_history_updates(app_instance: Any) -> None:
"""
Verifies that the internal performance history is updated correctly.
This logic is inside the render loop in gui_2.py, but we can test
the data structure and initialization.
"""
assert "fps" in app_instance.perf_history
assert len(app_instance.perf_history["fps"]) == 100