mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-06-30 19:12:07 +08:00
77d6d1a8f1
* get platform_str from the enum name * fix tests * add migration table * remove impossible todo * Add link to PR in MIGRATION table Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com> * Remove useless brand name comments and rename RAM_1500 to RAM_1500_5TH_GEN * rename RAM_HD to RAM_HD_5TH_GEN * rename references to RAM_HD and RAM_1500 * change "mock" to "MOCK" and rename torque data of Nissan Leaf 2018 IC * remove MOCK from fingerprints.py * change hard-coded car model in test_can_fingerprint.py/test_timing * migration * update ref * space * prius --------- Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com> Co-authored-by: justin newberry <justin@comma.ai> Co-authored-by: Justin Newberry <jnewberry0502@gmail.com> old-commit-hash: 489528dcae3888311f92075ba9e0f68626725121
42 lines
962 B
Python
42 lines
962 B
Python
import pytest
|
|
import unittest
|
|
|
|
import requests
|
|
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 = "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(CP.carFingerprint, fp)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|