Private
Public Access
0
0

refactor(test): 5 test files use live_gui_workspace fixture instead of hardcoded path

This commit is contained in:
2026-06-09 16:14:40 -04:00
parent 91313451a2
commit 006bb11488
5 changed files with 12 additions and 13 deletions
+2 -2
View File
@@ -12,12 +12,12 @@ sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "s
from src import api_hook_client
@pytest.mark.integration
def test_phase4_final_verify(live_gui):
def test_phase4_final_verify(live_gui, live_gui_workspace):
client = api_hook_client.ApiHookClient()
assert client.wait_for_server(timeout=15), "Hook server did not start"
# 1. Setup mock project data
workspace_dir = Path("tests/artifacts/live_gui_workspace")
workspace_dir = live_gui_workspace
workspace_dir.mkdir(parents=True, exist_ok=True)
# Create dummy files
+2 -2
View File
@@ -12,13 +12,13 @@ sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "s
from src import api_hook_client
@pytest.mark.integration
def test_rag_large_codebase_verification_sim(live_gui):
def test_rag_large_codebase_verification_sim(live_gui, live_gui_workspace):
client = api_hook_client.ApiHookClient()
assert client.wait_for_server(timeout=15), "Hook server did not start"
# 1. Setup mock large project data
# Create 50 dummy files to test parallel indexing and incrementality
workspace_dir = Path("tests/artifacts/live_gui_workspace")
workspace_dir = live_gui_workspace
workspace_dir.mkdir(parents=True, exist_ok=True)
file_names = [f"file_{i}.txt" for i in range(50)]
+4 -5
View File
@@ -5,13 +5,13 @@ from pathlib import Path
import tomli_w
from src.api_hook_client import ApiHookClient
def test_preset_switching(live_gui):
def test_preset_switching(live_gui, live_gui_workspace):
client = ApiHookClient()
client.click("btn_reset")
time.sleep(2)
# Paths for presets
temp_workspace = Path("tests/artifacts/live_gui_workspace")
temp_workspace = live_gui_workspace
global_presets_path = temp_workspace / "presets.toml"
project_presets_path = temp_workspace / "project_presets.toml"
manual_slop_path = temp_workspace / "manual_slop.toml"
@@ -96,7 +96,7 @@ def test_preset_switching(live_gui):
if global_presets_path.exists(): global_presets_path.unlink()
if project_presets_path.exists(): project_presets_path.unlink()
def test_preset_manager_modal(live_gui):
def test_preset_manager_modal(live_gui, live_gui_workspace):
client = ApiHookClient()
client.click("btn_reset")
time.sleep(2)
@@ -118,7 +118,6 @@ def test_preset_manager_modal(live_gui):
time.sleep(1)
# Verify it exists in file
temp_workspace = Path("tests/artifacts/live_gui_workspace")
global_presets_path = temp_workspace / "presets.toml"
global_presets_path = live_gui_workspace / "presets.toml"
# assert global_presets_path.exists(), f"Global presets file not found at {global_presets_path}. Full state: {client.get_gui_state()}"
+2 -2
View File
@@ -6,11 +6,11 @@ import json
from pathlib import Path
from src.api_hook_client import ApiHookClient
def test_tool_preset_switching(live_gui):
def test_tool_preset_switching(live_gui, live_gui_workspace):
client = ApiHookClient()
# Paths for tool presets
temp_workspace = Path("tests/artifacts/live_gui_workspace")
temp_workspace = live_gui_workspace
global_tool_presets_path = temp_workspace / "tool_presets.toml"
project_tool_presets_path = temp_workspace / "project_tool_presets.toml"
manual_slop_path = temp_workspace / "manual_slop.toml"
+2 -2
View File
@@ -57,7 +57,7 @@ def test_gui_ux_event_routing(live_gui) -> None:
print("[SIM] Performance verified.")
@pytest.mark.live
def test_gui_track_creation(live_gui) -> None:
def test_gui_track_creation(live_gui, live_gui_workspace) -> None:
client = api_hook_client.ApiHookClient()
client.click("btn_reset")
time.sleep(2)
@@ -76,7 +76,7 @@ def test_gui_track_creation(live_gui) -> None:
# Verify track exists on disk
# Path is calculated in _cb_create_track: track_id = f"{name.lower().replace(' ', '_')}_{date_suffix}"
temp_workspace = Path("tests/artifacts/live_gui_workspace")
temp_workspace = live_gui_workspace
tracks_dir = temp_workspace / "conductor" / "tracks"
assert tracks_dir.exists(), "Tracks directory not found"