- 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
19 lines
638 B
Python
19 lines
638 B
Python
"""OUI lookup tests."""
|
|
from esp32_web.utils.oui import _normalize_mac, lookup_vendor
|
|
|
|
|
|
def test_normalize_mac():
|
|
"""Test MAC normalization."""
|
|
assert _normalize_mac('aa:bb:cc:dd:ee:ff') == 'AABBCC'
|
|
assert _normalize_mac('AA-BB-CC-DD-EE-FF') == 'AABBCC'
|
|
assert _normalize_mac('aabbccddeeff') == 'AABBCC'
|
|
assert _normalize_mac('short') == ''
|
|
|
|
|
|
def test_lookup_vendor_no_db():
|
|
"""Test vendor lookup without database."""
|
|
# Should return None when no database loaded
|
|
result = lookup_vendor('aa:bb:cc:dd:ee:ff')
|
|
# Result depends on whether OUI db exists
|
|
assert result is None or isinstance(result, str)
|