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 subprocess
|
||||||
import os
|
import os
|
||||||
|
|
||||||
def main():
|
def main() -> None:
|
||||||
# Debug log to stderr
|
|
||||||
sys.stderr.write(f"DEBUG: mock_gemini_cli called with args: {sys.argv}\n")
|
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")
|
sys.stderr.write(f"DEBUG: GEMINI_CLI_HOOK_CONTEXT: {os.environ.get('GEMINI_CLI_HOOK_CONTEXT')}\n")
|
||||||
# Read prompt from stdin
|
# 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
|
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.
|
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
|
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.
|
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()
|
app = gui_legacy.App()
|
||||||
assert getattr(app, 'test_hooks_enabled', False) is False
|
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.
|
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
|
from api_hook_client import ApiHookClient
|
||||||
|
|
||||||
@pytest.mark.integration
|
@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.
|
Integration test that drives the GUI through a full workflow.
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import requests
|
|||||||
import pytest
|
import pytest
|
||||||
from api_hook_client import ApiHookClient
|
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.
|
Tests the request_confirmation method in ApiHookClient.
|
||||||
"""
|
"""
|
||||||
@@ -13,7 +13,7 @@ def test_api_ask_client_method(live_gui):
|
|||||||
client.get_events()
|
client.get_events()
|
||||||
results = {"response": None, "error": None}
|
results = {"response": None, "error": None}
|
||||||
|
|
||||||
def make_blocking_request():
|
def make_blocking_request() -> None:
|
||||||
try:
|
try:
|
||||||
# This call should block until we respond
|
# This call should block until we respond
|
||||||
results["response"] = client.request_confirmation(
|
results["response"] = client.request_confirmation(
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ from models import TrackState, Metadata, Ticket
|
|||||||
# Import the persistence functions from project_manager
|
# Import the persistence functions from project_manager
|
||||||
from project_manager import save_track_state, load_track_state
|
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.
|
Tests saving and loading a TrackState object to/from a TOML file.
|
||||||
1. Create a TrackState object with sample metadata, discussion, and tasks.
|
1. Create a TrackState object with sample metadata, discussion, and tasks.
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
import subprocess
|
import subprocess
|
||||||
import time
|
import time
|
||||||
import sys
|
import sys
|
||||||
@@ -14,8 +13,8 @@ from api_hook_client import ApiHookClient
|
|||||||
|
|
||||||
class TestMMAGUIRobust(unittest.TestCase):
|
class TestMMAGUIRobust(unittest.TestCase):
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls) -> None:
|
||||||
# 1. Launch gui_2.py with --enable-test-hooks
|
# 1. Launch gui_2.py with --enable-test-hooks
|
||||||
cls.gui_command = [sys.executable, "gui_2.py", "--enable-test-hooks"]
|
cls.gui_command = [sys.executable, "gui_2.py", "--enable-test-hooks"]
|
||||||
print(f"Launching GUI: {' '.join(cls.gui_command)}")
|
print(f"Launching GUI: {' '.join(cls.gui_command)}")
|
||||||
cls.gui_process = subprocess.Popen(
|
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
|
from api_hook_client import ApiHookClient
|
||||||
|
|
||||||
@pytest.mark.integration
|
@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.
|
Integration test for the full MMA Epic lifecycle.
|
||||||
1. Start App.
|
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
|
from api_hook_client import ApiHookClient
|
||||||
|
|
||||||
@pytest.mark.integration
|
@pytest.mark.integration
|
||||||
def test_mma_epic_simulation(live_gui):
|
def test_mma_epic_simulation(live_gui) -> None:
|
||||||
"""
|
"""
|
||||||
Integration test for MMA epic simulation.
|
Integration test for MMA epic simulation.
|
||||||
Red Phase: asserts False.
|
Red Phase: asserts False.
|
||||||
|
|||||||
Reference in New Issue
Block a user