# API tests HTTP tests against a running controller, ported from the Python app's endpoint tests (`tests/test_endpoints_pytest.py` and `tests/test_endpoints.py`) on both the `animation-engine` and `main` lines, plus `main`'s bundle, audio, group and sequence tests where they work over HTTP. They need `pytest`, `requests` and `websocket-client`. ```bash make test-api HOST=10.1.1.180 ``` or `python3 -m pytest test/api --host ` (or set `LED_HOST`). Without a host every test is skipped. The tests create and delete profiles, presets, zones and so on. The sequence tests switch mic timing off and run the beat clock at 200 BPM for a few seconds; mic timing is switched back on afterwards. Before the run they save every collection (`GET /db/`), and afterwards they write each one back (`PUT /db/`). Zone play and preset send do go out over ESP-NOW. They use made-up driver names (`pytest-a`, `pytest-nobody`) so real drivers ignore them. ## v1 features v2 does not have yet A test for v1 behaviour that v2 is missing is marked `@missing("")`. That is a strict `xfail`, so the test shows as `x`, and it fails as `XPASS(strict)` once the feature works. When that happens, remove the marker. To list what is still missing: ```bash python3 -m pytest test/api --host -rx ``` v1 tests that were not ported: - the model and engine unit tests (`tests/models/`, `tests/engine_tests/`), which test Python modules that have no C counterpart; - the Wi-Fi/TCP/UDP driver test servers. The checks on exact driver messages became checks on status codes and replies, because ESP-NOW frames can't be captured from outside the board. The Selenium UI tests are in `test/browser/` (`make test-browser HOST=`).