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

Function main

examples/Asio/Server/test_client.py:158–185  ·  view source on GitHub ↗

Main entry point.

()

Source from the content-addressed store, hash-verified

156
157
158def main() -> int:
159 """Main entry point."""
160 parser = argparse.ArgumentParser(description="Test FastLED Network example")
161 parser.add_argument("--host", default="localhost", help="Server host")
162 parser.add_argument("--port", type=int, default=8080, help="Server port")
163 parser.add_argument("--requests", type=int, default=5, help="Number of requests")
164 args = parser.parse_args()
165
166 config = TestConfig(host=args.host, port=args.port, num_requests=args.requests)
167
168 console.print("[bold]FastLED Network Example Test Client[/bold]")
169 console.print(f"Server: http://{config.host}:{config.port}\n")
170
171 # Wait for server
172 if not wait_for_server(config):
173 console.print("\nERROR: Server not available", style="red bold")
174 console.print("\nTroubleshooting:")
175 console.print("1. Compile: bash compile posix --examples Server")
176 console.print("2. Run: .build/meson-quick/examples/Server.exe")
177 return 1
178
179 # Run tests
180 results = run_tests(config)
181
182 # Display statistics
183 display_statistics(results)
184
185 return 0 if all(r.success for r in results) else 1
186
187
188def test_network_example() -> None:

Callers 1

test_client.pyFile · 0.70

Calls 7

wait_for_serverFunction · 0.85
display_statisticsFunction · 0.85
allFunction · 0.85
parse_argsMethod · 0.80
TestConfigClass · 0.70
run_testsFunction · 0.70
printMethod · 0.45

Tested by

no test coverage detected