- 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
26 lines
676 B
Python
26 lines
676 B
Python
"""BLE company lookup tests."""
|
|
from esp32_web.utils.ble_companies import lookup_ble_company, get_all_companies
|
|
|
|
|
|
def test_lookup_apple():
|
|
"""Test Apple company ID lookup."""
|
|
assert lookup_ble_company(0x004C) == 'Apple, Inc.'
|
|
|
|
|
|
def test_lookup_google():
|
|
"""Test Google company ID lookup."""
|
|
assert lookup_ble_company(0x00E0) == 'Google'
|
|
|
|
|
|
def test_lookup_unknown():
|
|
"""Test unknown company ID lookup."""
|
|
assert lookup_ble_company(0xFFFF) is None
|
|
|
|
|
|
def test_get_all_companies():
|
|
"""Test getting all companies."""
|
|
companies = get_all_companies()
|
|
assert isinstance(companies, dict)
|
|
assert len(companies) > 0
|
|
assert 0x004C in companies
|