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.
12 lines
100 B
Text
12 lines
100 B
Text
.vscode
|
|
.venv
|
|
.env
|
|
.env.*
|
|
!env_sample
|
|
*.key
|
|
*.pem
|
|
*.crt
|
|
.DS_Store
|
|
__pycache__/
|
|
*.pyc
|
|
.pytest_cache/
|