Files
led-controller/tests
Jimmy ace5770b3a refactor(api): complete fastapi migration and related features
Finish native FastAPI controllers, drop vendored microdot, and add
Wi-Fi driver runtime, beat SSE, simulated BPM, sequence playback
improvements, bridge ESP-NOW sources, UI updates, and tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-11 22:55:28 +12:00
..

Tests

Tests for the LED Controller project live under tests/ (pytest + legacy scripts).

Layout

Path Role
test_endpoints.py HTTP endpoint checks (LED_CONTROLLER_RUN_DEVICE_ENDPOINT_TESTS=1); test_zones / test_zone_edit_workflow hit /zones
api_server.py Shared FastAPI TestClient fixture (server) for in-process API tests
test_endpoints_pytest.py Pytest API coverage (profiles, zones, devices, bridge, audio, patterns)
test_bridge_ws_client.py Bridge WebSocket client reconnect / send behaviour
test_bridge_envelope.py Devices envelope build/split/delivery
test_bridge_serial_frame.py Pi↔bridge USB serial framing
test_bridge_wifi_connect.py Saved bridge profile connect (serial path)
test_espnow_wire.py, test_espnow_ping.py Binary wire codec and ping registration
test_binary_envelope.py v2 binary envelope encode/decode
test_browser.py Selenium UI flows (set LED_CONTROLLER_RUN_BROWSER_TESTS=1 to run; uses test_zones_ui and legacy tabsManager JS aliases)
test_pattern_ota_send.py Pattern OTA / Wi-Fi send helpers
test_pi_wifi_scan.py nmcli SSID scan helpers
tcp_test_server.py, async_tcp_server.py TCP test doubles for driver protocol
udp_server.py UDP discovery / hello test listener (port 8766)
bridge_broadcast_test.py Manual bridge WebSocket broadcast script
ws.py WebSocket client checks
web.py Local dev server on port 5000 (pipenv run web)
conftest.py Pytest fixtures
models/ Model unit tests (run_all.py, test_zone.py, …)

Running tests

From the project root (with dev dependencies installed):

pipenv run pytest tests/ -q

Browser tests (real browser)

python tests/test_browser.py

Requires Selenium, Chrome/Chromium, and a matching ChromeDriver.

Model tests only

python tests/models/run_all.py

Local dev server (port 5000)

pipenv run web runs the FastAPI app on http://localhost:5000 (production-style default is pipenv run run on port 80).