Verify Serial Studio API server is running. Security tests MUST have the API server enabled.
()
| 67 | |
| 68 | @pytest.fixture(scope="session") |
| 69 | def 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 |
nothing calls this directly
no test coverage detected