chore(tests): Final stabilization of test suite and full isolation of live_gui artifacts
This commit is contained in:
@@ -2,28 +2,17 @@ import pytest
|
||||
from typing import Any
|
||||
import sys
|
||||
import os
|
||||
import importlib.util
|
||||
|
||||
# Ensure project root is in path
|
||||
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
|
||||
|
||||
# Load gui_2.py
|
||||
spec = importlib.util.spec_from_file_location("gui_2", "gui_2.py")
|
||||
gui_2 = importlib.util.module_from_spec(spec)
|
||||
sys.modules["gui_2"] = gui_2
|
||||
spec.loader.exec_module(gui_2)
|
||||
from gui_2 import App
|
||||
|
||||
def test_new_hubs_defined_in_show_windows() -> None:
|
||||
def test_new_hubs_defined_in_show_windows(mock_app: App) -> None:
|
||||
"""
|
||||
Verifies that the new consolidated Hub windows are defined in the App's show_windows.
|
||||
This ensures they will be available in the 'Windows' menu.
|
||||
"""
|
||||
# We don't need a full App instance with ImGui context for this,
|
||||
# as show_windows is initialized in __init__.
|
||||
from unittest.mock import patch
|
||||
with patch('gui_2.load_config', return_value={}):
|
||||
app = App()
|
||||
expected_hubs = [
|
||||
"Context Hub",
|
||||
"AI Settings",
|
||||
@@ -31,7 +20,7 @@ def test_new_hubs_defined_in_show_windows() -> None:
|
||||
"Operations Hub",
|
||||
]
|
||||
for hub in expected_hubs:
|
||||
assert hub in app.show_windows, f"Expected window {hub} not found in show_windows"
|
||||
assert hub in mock_app.show_windows, f"Expected window {hub} not found in show_windows"
|
||||
|
||||
def test_old_windows_removed_from_gui2(app_instance_simple: Any) -> None:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user