- MAC vendor lookup (IEEE OUI database) - BLE company_id to manufacturer mapping - Device profile enrichment in API responses - Export endpoints: devices.csv, devices.json, alerts.csv, probes.csv - Auto-populate vendor on device creation - CLI command: flask download-oui - Makefile target: make oui 13 tests passing
24 lines
681 B
Python
24 lines
681 B
Python
"""Sensor API tests."""
|
|
|
|
|
|
def test_list_sensors_empty(client):
|
|
"""Test listing sensors when empty."""
|
|
response = client.get('/api/v1/sensors')
|
|
assert response.status_code == 200
|
|
assert response.json == {'sensors': []}
|
|
|
|
|
|
def test_get_sensor_not_found(client):
|
|
"""Test getting non-existent sensor."""
|
|
response = client.get('/api/v1/sensors/nonexistent')
|
|
assert response.status_code == 404
|
|
|
|
|
|
def test_health_check(client):
|
|
"""Test health endpoint."""
|
|
response = client.get('/health')
|
|
assert response.status_code == 200
|
|
assert response.json['status'] == 'ok'
|
|
assert 'uptime' in response.json
|
|
assert 'uptime_seconds' in response.json
|