conductor(checkpoint): Checkpoint end of Phase 3 and final track completion
This commit is contained in:
@@ -1,28 +0,0 @@
|
||||
import pytest
|
||||
import time
|
||||
import sys
|
||||
import os
|
||||
import requests
|
||||
|
||||
# Ensure project root is in path
|
||||
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
|
||||
|
||||
from api_hook_client import ApiHookClient
|
||||
|
||||
def test_client_wait_for_server(live_gui):
|
||||
"""Verifies that the client can wait for the server to become ready."""
|
||||
client = ApiHookClient()
|
||||
assert client.wait_for_server(timeout=5) is True
|
||||
|
||||
def test_client_get_performance_retry(live_gui):
|
||||
"""Verifies that the client can retrieve metrics correctly."""
|
||||
client = ApiHookClient()
|
||||
perf = client.get_performance()
|
||||
assert "performance" in perf
|
||||
|
||||
def test_client_connection_error():
|
||||
"""Verifies that the client raises a Connection or Timeout error when the server is down."""
|
||||
# Use a port that is unlikely to be in use and not intercepted
|
||||
client = ApiHookClient(base_url="http://127.0.0.1:9998", max_retries=1, retry_delay=0.1)
|
||||
with pytest.raises((requests.exceptions.ConnectionError, requests.exceptions.Timeout)):
|
||||
client.get_project()
|
||||
@@ -1,21 +0,0 @@
|
||||
import pytest
|
||||
import requests
|
||||
|
||||
def test_gui_fixture_auto_starts(live_gui):
|
||||
"""
|
||||
Verifies that the live_gui fixture correctly starts the GUI
|
||||
and the hook server is reachable on port 8999.
|
||||
"""
|
||||
response = requests.get("http://127.0.0.1:8999/status")
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
assert data["status"] == "ok"
|
||||
|
||||
def test_get_performance_metrics(live_gui):
|
||||
"""
|
||||
Verifies that we can retrieve performance metrics via the hook server.
|
||||
"""
|
||||
response = requests.get("http://127.0.0.1:8999/api/performance")
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
assert "performance" in data
|
||||
@@ -1,13 +0,0 @@
|
||||
import pytest
|
||||
import subprocess
|
||||
import time
|
||||
import requests
|
||||
|
||||
def test_gui_fixture_auto_starts():
|
||||
# This test should fail if the fixture isn't working yet.
|
||||
# It attempts to reach the hook server without starting it manually.
|
||||
try:
|
||||
response = requests.post("http://localhost:5000/get_ui_performance", json={})
|
||||
assert response.status_code == 200
|
||||
except requests.exceptions.ConnectionError:
|
||||
pytest.fail("Hook server is not running. Fixture failed or is missing.")
|
||||
Reference in New Issue
Block a user