mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-19 18:13:55 +08:00
* with brand name
* migrate
* Fix
* fixes
* more
* passes
* fix
* fix the doc
* collects
* these too
* more stuff
* body exception :/
* more
* hardcode i guess
* update ref
* toyota
* more toyota
* and here
* final!
* fix notebooks and ccs
* move this here
old-commit-hash: b0eb3ba4f4
40 lines
1.0 KiB
Python
40 lines
1.0 KiB
Python
import pytest
|
|
import unittest
|
|
import requests
|
|
from openpilot.selfdrive.car.fingerprints import MIGRATION
|
|
from openpilot.tools.lib.comma_car_segments import get_comma_car_segments_database, get_url
|
|
from openpilot.tools.lib.logreader import LogReader
|
|
from openpilot.tools.lib.route import SegmentRange
|
|
|
|
|
|
@pytest.mark.skip(reason="huggingface is flaky, run this test manually to check for issues")
|
|
class TestCommaCarSegments(unittest.TestCase):
|
|
def test_database(self):
|
|
database = get_comma_car_segments_database()
|
|
|
|
platforms = database.keys()
|
|
|
|
assert len(platforms) > 100
|
|
|
|
def test_download_segment(self):
|
|
database = get_comma_car_segments_database()
|
|
|
|
fp = "SUBARU_FORESTER"
|
|
|
|
segment = database[fp][0]
|
|
|
|
sr = SegmentRange(segment)
|
|
|
|
url = get_url(sr.route_name, sr.slice)
|
|
|
|
resp = requests.get(url)
|
|
self.assertEqual(resp.status_code, 200)
|
|
|
|
lr = LogReader(url)
|
|
CP = lr.first("carParams")
|
|
self.assertEqual(MIGRATION.get(CP.carFingerprint, CP.carFingerprint), fp)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|