-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Volkswagen: test FW version format (#32162)
* add test * more explicit
- Loading branch information
Showing
2 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env python3 | ||
import unittest | ||
|
||
from openpilot.selfdrive.car.volkswagen.values import SPARE_PART_FW_PATTERN | ||
from openpilot.selfdrive.car.volkswagen.fingerprints import FW_VERSIONS | ||
|
||
|
||
class TestVolkswagenPlatformConfigs(unittest.TestCase): | ||
def test_spare_part_fw_pattern(self): | ||
# Relied on for determining if a FW is likely VW | ||
for platform, ecus in FW_VERSIONS.items(): | ||
with self.subTest(platform=platform): | ||
for fws in ecus.values(): | ||
for fw in fws: | ||
self.assertNotEqual(SPARE_PART_FW_PATTERN.match(fw), None, f"Bad FW: {fw}") | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters