fix(conductor): Apply review suggestions for track 'gui_performance_20260223'
This commit is contained in:
@@ -31,27 +31,31 @@ def test_hooks_enabled_via_env():
|
||||
def test_ipc_server_starts_and_responds():
|
||||
app_mock = gui.App()
|
||||
app_mock.test_hooks_enabled = True
|
||||
server = api_hooks.HookServer(app_mock, port=8999)
|
||||
server = api_hooks.HookServer(app_mock, port=0)
|
||||
server.start()
|
||||
|
||||
# Wait for server to start
|
||||
time.sleep(0.5)
|
||||
|
||||
actual_port = server.server.server_address[1]
|
||||
base_url = f"http://127.0.0.1:{actual_port}"
|
||||
|
||||
try:
|
||||
req = urllib.request.Request("http://127.0.0.1:8999/status")
|
||||
req = urllib.request.Request(f"{base_url}/status")
|
||||
with urllib.request.urlopen(req) as response:
|
||||
assert response.status == 200
|
||||
data = json.loads(response.read().decode())
|
||||
assert data.get("status") == "ok"
|
||||
|
||||
# Test project GET
|
||||
req = urllib.request.Request("http://127.0.0.1:8999/api/project")
|
||||
req = urllib.request.Request(f"{base_url}/api/project")
|
||||
with urllib.request.urlopen(req) as response:
|
||||
assert response.status == 200
|
||||
data = json.loads(response.read().decode())
|
||||
assert "project" in data
|
||||
|
||||
# Test session GET
|
||||
req = urllib.request.Request("http://127.0.0.1:8999/api/session")
|
||||
req = urllib.request.Request(f"{base_url}/api/session")
|
||||
with urllib.request.urlopen(req) as response:
|
||||
assert response.status == 200
|
||||
data = json.loads(response.read().decode())
|
||||
@@ -60,7 +64,7 @@ def test_ipc_server_starts_and_responds():
|
||||
# Test project POST
|
||||
project_data = {"project": {"foo": "bar"}}
|
||||
req = urllib.request.Request(
|
||||
"http://127.0.0.1:8999/api/project",
|
||||
f"{base_url}/api/project",
|
||||
method="POST",
|
||||
data=json.dumps(project_data).encode("utf-8"),
|
||||
headers={'Content-Type': 'application/json'})
|
||||
@@ -71,7 +75,7 @@ def test_ipc_server_starts_and_responds():
|
||||
# Test session POST
|
||||
session_data = {"session": {"entries": [{"role": "User", "content": "hi"}]}}
|
||||
req = urllib.request.Request(
|
||||
"http://127.0.0.1:8999/api/session",
|
||||
f"{base_url}/api/session",
|
||||
method="POST",
|
||||
data=json.dumps(session_data).encode("utf-8"),
|
||||
headers={'Content-Type': 'application/json'})
|
||||
@@ -82,7 +86,7 @@ def test_ipc_server_starts_and_responds():
|
||||
# Test GUI queue hook
|
||||
gui_data = {"action": "set_value", "item": "test_item", "value": "test_value"}
|
||||
req = urllib.request.Request(
|
||||
"http://127.0.0.1:8999/api/gui",
|
||||
f"{base_url}/api/gui",
|
||||
method="POST",
|
||||
data=json.dumps(gui_data).encode("utf-8"),
|
||||
headers={'Content-Type': 'application/json'})
|
||||
|
||||
Reference in New Issue
Block a user