48 tests, ~0.1s total. Each case targets a specific bug class so the
file reads as a contract:
- test_validation.py
accepts well-formed device ids, rejects whitespace, slashes,
colons, newlines, zero-width spaces, oversize values, HTML.
- test_alert_predicate.py
threshold boundary, bool-vs-int trap, NaN / inf / out-of-range,
non-numeric payloads, per-device cooldown window.
- test_active_snapshot.py
recent vs stale, the "<= prune_seconds" boundary (inclusive),
missing last_seen treated as ancient, empty state.
- test_ws_token.py
open mode, missing/wrong/empty/extra-param query strings, plus
the happy path with the correct token.
conftest.py stubs MQTT_BROKER and prepends the repo root to sys.path
so `import backend` works without a .env file. Dev deps split into
requirements-dev.txt to keep the runtime image lean.
3 lines
56 B
Text
3 lines
56 B
Text
-r requirements.txt
|
|
pytest==8.4.2
|
|
pytest-asyncio==1.2.0
|