MCPcopy Create free account
hub / github.com/FastLED/FastLED / test_network_example

Function test_network_example

examples/Asio/Server/test_client.py:188–200  ·  view source on GitHub ↗

Pytest test for Network example.

()

Source from the content-addressed store, hash-verified

186
187
188def test_network_example() -> None:
189 """Pytest test for Network example."""
190 config = TestConfig(num_requests=3, max_retries=5)
191
192 if not wait_for_server(config):
193 raise RuntimeError("Server not available")
194
195 url = f"http://{config.host}:{config.port}/"
196 with httpx.Client() as client:
197 result = send_request(client, url, config)
198 assert result.success, f"Request failed: {result.error_message}"
199 assert result.status_code == 200
200 assert result.response_time_ms < 1000
201
202
203if __name__ == "__main__":

Callers

nothing calls this directly

Calls 3

wait_for_serverFunction · 0.85
send_requestFunction · 0.85
TestConfigClass · 0.70

Tested by

no test coverage detected