refactor(tests): Add strict type hints to sixth batch of test files
This commit is contained in:
@@ -3,8 +3,7 @@ import json
|
||||
import subprocess
|
||||
import os
|
||||
|
||||
def main():
|
||||
# Debug log to stderr
|
||||
def main() -> None:
|
||||
sys.stderr.write(f"DEBUG: mock_gemini_cli called with args: {sys.argv}\n")
|
||||
sys.stderr.write(f"DEBUG: GEMINI_CLI_HOOK_CONTEXT: {os.environ.get('GEMINI_CLI_HOOK_CONTEXT')}\n")
|
||||
# Read prompt from stdin
|
||||
|
||||
@@ -8,7 +8,7 @@ sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
|
||||
|
||||
from api_hook_client import ApiHookClient
|
||||
|
||||
def test_idle_performance_requirements(live_gui):
|
||||
def test_idle_performance_requirements(live_gui) -> None:
|
||||
"""
|
||||
Requirement: GUI must maintain stable performance on idle.
|
||||
"""
|
||||
|
||||
@@ -8,7 +8,7 @@ sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
|
||||
|
||||
from api_hook_client import ApiHookClient
|
||||
|
||||
def test_comms_volume_stress_performance(live_gui):
|
||||
def test_comms_volume_stress_performance(live_gui) -> None:
|
||||
"""
|
||||
Stress test: Inject many session entries and verify performance doesn't degrade.
|
||||
"""
|
||||
|
||||
@@ -23,7 +23,7 @@ def test_hooks_disabled_by_default() -> None:
|
||||
app = gui_legacy.App()
|
||||
assert getattr(app, 'test_hooks_enabled', False) is False
|
||||
|
||||
def test_live_hook_server_responses(live_gui):
|
||||
def test_live_hook_server_responses(live_gui) -> None:
|
||||
"""
|
||||
Verifies the live hook server (started via fixture) responds correctly to all major endpoints.
|
||||
"""
|
||||
|
||||
@@ -9,7 +9,7 @@ sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
|
||||
from api_hook_client import ApiHookClient
|
||||
|
||||
@pytest.mark.integration
|
||||
def test_full_live_workflow(live_gui):
|
||||
def test_full_live_workflow(live_gui) -> None:
|
||||
"""
|
||||
Integration test that drives the GUI through a full workflow.
|
||||
"""
|
||||
|
||||
@@ -4,7 +4,7 @@ import requests
|
||||
import pytest
|
||||
from api_hook_client import ApiHookClient
|
||||
|
||||
def test_api_ask_client_method(live_gui):
|
||||
def test_api_ask_client_method(live_gui) -> None:
|
||||
"""
|
||||
Tests the request_confirmation method in ApiHookClient.
|
||||
"""
|
||||
@@ -13,7 +13,7 @@ def test_api_ask_client_method(live_gui):
|
||||
client.get_events()
|
||||
results = {"response": None, "error": None}
|
||||
|
||||
def make_blocking_request():
|
||||
def make_blocking_request() -> None:
|
||||
try:
|
||||
# This call should block until we respond
|
||||
results["response"] = client.request_confirmation(
|
||||
|
||||
@@ -8,7 +8,7 @@ from models import TrackState, Metadata, Ticket
|
||||
# Import the persistence functions from project_manager
|
||||
from project_manager import save_track_state, load_track_state
|
||||
|
||||
def test_track_state_persistence(tmp_path):
|
||||
def test_track_state_persistence(tmp_path) -> None:
|
||||
"""
|
||||
Tests saving and loading a TrackState object to/from a TOML file.
|
||||
1. Create a TrackState object with sample metadata, discussion, and tasks.
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
import subprocess
|
||||
import time
|
||||
import sys
|
||||
@@ -14,8 +13,8 @@ from api_hook_client import ApiHookClient
|
||||
|
||||
class TestMMAGUIRobust(unittest.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
# 1. Launch gui_2.py with --enable-test-hooks
|
||||
def setUpClass(cls) -> None:
|
||||
# 1. Launch gui_2.py with --enable-test-hooks
|
||||
cls.gui_command = [sys.executable, "gui_2.py", "--enable-test-hooks"]
|
||||
print(f"Launching GUI: {' '.join(cls.gui_command)}")
|
||||
cls.gui_process = subprocess.Popen(
|
||||
|
||||
@@ -10,7 +10,7 @@ sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
|
||||
from api_hook_client import ApiHookClient
|
||||
|
||||
@pytest.mark.integration
|
||||
def test_mma_epic_lifecycle(live_gui):
|
||||
def test_mma_epic_lifecycle(live_gui) -> None:
|
||||
"""
|
||||
Integration test for the full MMA Epic lifecycle.
|
||||
1. Start App.
|
||||
|
||||
@@ -9,7 +9,7 @@ sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
|
||||
from api_hook_client import ApiHookClient
|
||||
|
||||
@pytest.mark.integration
|
||||
def test_mma_epic_simulation(live_gui):
|
||||
def test_mma_epic_simulation(live_gui) -> None:
|
||||
"""
|
||||
Integration test for MMA epic simulation.
|
||||
Red Phase: asserts False.
|
||||
|
||||
Reference in New Issue
Block a user