mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-12-03 20:33:40 +08:00
Align vehicle fixtures and avoid reserved unittest loader name
Test an unsupported two-count Polestar replica lag while preserving RX/TX rejection. Match current GM stock-owner flags without removing any parser-validity assertion. Rename the imported laboratory fixture so unittest does not invoke a module as load_tests. 125 combined focused checks pass;7 unittest checks independently pass; Ruff passes. Production and native artifacts unchanged; canonical inventory refreshed.
This commit is contained in:
@@ -62,7 +62,8 @@ class TestGMAutoIdentity(unittest.TestCase):
|
||||
from opendbc.car.gm.fingerprints import FINGERPRINTS
|
||||
from opendbc.car.gm.interface import CarInterface
|
||||
from opendbc.car.gm.values import (CAR, DBC, GMFlags, ORDINARY_CC_WORD, MALIBU_CC_F1_WORD,
|
||||
MALIBU_CC_F1_STOCK_WORD, is_ordinary_cc_profile, control_flags)
|
||||
MALIBU_CC_F1_STOCK_WORD, GMSafetyFlags, is_ordinary_cc_profile,
|
||||
is_ordinary_cc_stock_profile, control_flags)
|
||||
from opendbc.car import structs
|
||||
from openpilot.starpilot.vehicle_preferences import VehicleStartupPreferences
|
||||
from opendbc.car.gm.tests.test_cc_gateway_stock import pt_frames
|
||||
@@ -93,10 +94,12 @@ class TestGMAutoIdentity(unittest.TestCase):
|
||||
preferences = VehicleStartupPreferences(disable_bolt_long=True)
|
||||
preferences.prepare(disabled, fingerprints=fp)
|
||||
preferences.finalize(disabled)
|
||||
self.assertTrue(is_ordinary_cc_profile(disabled), identity)
|
||||
self.assertTrue((is_ordinary_cc_profile if f1 else is_ordinary_cc_stock_profile)(disabled), identity)
|
||||
self.assertFalse(disabled.openpilotLongitudinalControl)
|
||||
self.assertEqual(disabled.pcmCruise, f1)
|
||||
self.assertEqual(disabled.safetyConfigs[0].safetyParam, MALIBU_CC_F1_STOCK_WORD if f1 else expected_word)
|
||||
self.assertTrue(disabled.pcmCruise)
|
||||
self.assertFalse(disabled.autoResumeSng)
|
||||
self.assertEqual(control_flags(disabled), expected_flags if f1 else 0)
|
||||
self.assertEqual(disabled.safetyConfigs[0].safetyParam, MALIBU_CC_F1_STOCK_WORD if f1 else GMSafetyFlags.NO_ACC)
|
||||
ci = CarInterface(cp)
|
||||
packer = CANPacker(DBC[car][Bus.pt])
|
||||
for tick in range(40):
|
||||
|
||||
@@ -51,7 +51,8 @@ def test_recomputed_crc_cannot_validate_unknown_pscm_counter_domain(identity, ki
|
||||
address, data, bus = next(msg for msg in incoming if msg[0] == 0x17)
|
||||
changed = bytearray(data)
|
||||
if kind == 'unreplicated':
|
||||
changed[1] ^= 0x10
|
||||
# A one-count replica lag is supported on Polestar; two counts is not.
|
||||
changed[1] ^= 0x20
|
||||
elif kind == 'reserved_counter':
|
||||
changed[1] = 0xF0
|
||||
changed[2] = 0x8F
|
||||
|
||||
@@ -9,7 +9,7 @@ from tinygrad import Tensor
|
||||
|
||||
from openpilot.starpilot.models import laboratory, laboratory_runner
|
||||
from openpilot.starpilot.models.runner import CatalogModelState, SUPPORTED_VERSIONS
|
||||
from openpilot.starpilot.models.tests import test_laboratory_runner as load_tests
|
||||
from openpilot.starpilot.models.tests import test_laboratory_runner as load_fixture
|
||||
|
||||
|
||||
class TestCoherentOutput(unittest.TestCase):
|
||||
@@ -76,8 +76,8 @@ class TestCoherentOutput(unittest.TestCase):
|
||||
|
||||
|
||||
class TestCoherentFactory(unittest.TestCase):
|
||||
setUp = load_tests.TestLaboratoryLoad.setUp
|
||||
factory = load_tests.TestLaboratoryLoad.factory
|
||||
setUp = load_fixture.TestLaboratoryLoad.setUp
|
||||
factory = load_fixture.TestLaboratoryLoad.factory
|
||||
|
||||
def test_all_supported_versions_apply_after_verification_before_warmup(self):
|
||||
original = laboratory.freeze_request(self.root)
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
{"protected_inventory_sha256": "e33ff02a03fc31130454d06e42da660a1a0b38ecf6565330b83f0725e53a4f7e", "schema_version": 1}
|
||||
{"protected_inventory_sha256": "e4de8d02977a73dfa45fca44505a69260a8a68073be23c1a90e919f2276588f6", "schema_version": 1}
|
||||
|
||||
Reference in New Issue
Block a user