MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / api_server_required

Function api_server_required

tests/security/conftest.py:69–91  ·  view source on GitHub ↗

Verify Serial Studio API server is running. Security tests MUST have the API server enabled.

()

Source from the content-addressed store, hash-verified

67
68@pytest.fixture(scope="session")
69def api_server_required():
70 """
71 Verify Serial Studio API server is running.
72
73 Security tests MUST have the API server enabled.
74 """
75 try:
76 client = SerialStudioClient(timeout=2.0)
77 client.connect()
78 client.disconnect()
79 return True
80 except ConnectionError:
81 pytest.fail(
82 "\n\n"
83 "=" * 70 + "\n"
84 "Serial Studio API Server is NOT running!\n\n"
85 "Security tests require the API server to be enabled.\n\n"
86 "Please:\n"
87 " 1. Start Serial Studio\n"
88 " 2. Enable API Server (Settings → API → Enable)\n"
89 " 3. Verify it's listening on localhost:7777\n"
90 "=" * 70
91 )
92
93
94@pytest.fixture

Callers

nothing calls this directly

Calls 3

connectMethod · 0.95
disconnectMethod · 0.95
SerialStudioClientClass · 0.90

Tested by

no test coverage detected