2024-06-11 01:36:40 +00:00
|
|
|
import re
|
|
|
|
|
2025-01-29 09:09:58 +00:00
|
|
|
from opendbc.car.honda.fingerprints import FW_VERSIONS
|
2024-06-11 01:36:40 +00:00
|
|
|
|
|
|
|
HONDA_FW_VERSION_RE = br"[A-Z0-9]{5}-[A-Z0-9]{3}(-|,)[A-Z0-9]{4}(\x00){2}$"
|
|
|
|
|
|
|
|
|
|
|
|
class TestHondaFingerprint:
|
|
|
|
def test_fw_version_format(self):
|
|
|
|
# Asserts all FW versions follow an expected format
|
|
|
|
for fw_by_ecu in FW_VERSIONS.values():
|
|
|
|
for fws in fw_by_ecu.values():
|
|
|
|
for fw in fws:
|
|
|
|
assert re.match(HONDA_FW_VERSION_RE, fw) is not None, fw
|