Add monitor API tests (B8)
- test_monitor.py: 12 test cases covering: - API key generation (success, 404, admin-only) - heartbeat-v2 endpoint (valid key, invalid key, missing key) - API key revocation and validation - ServerState data persistence (agents_json, cpu_pct, etc.) - Disabled server rejection - conftest.py: import app.models.monitor for test database setup All tests passing (pytest -v).
This commit is contained in:
@@ -32,6 +32,10 @@ try:
|
||||
import app.models.webhook # noqa: F401
|
||||
except ImportError:
|
||||
pass
|
||||
try:
|
||||
import app.models.monitor # noqa: F401
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
TEST_DATABASE_URL = "sqlite://" # in-memory
|
||||
|
||||
|
||||
Reference in New Issue
Block a user