|
|
@ -115,36 +115,26 @@ class TestToyotaFingerprint(unittest.TestCase): |
|
|
|
# # Some examples of valid formats: b"56310-L0010", b"56310L0010", b"56310/M6300" |
|
|
|
# # Some examples of valid formats: b"56310-L0010", b"56310L0010", b"56310/M6300" |
|
|
|
# self.assertTrue(all({b"-" in code for code, _ in codes}), |
|
|
|
# self.assertTrue(all({b"-" in code for code, _ in codes}), |
|
|
|
# f"FW does not have part number: {fw}") |
|
|
|
# f"FW does not have part number: {fw}") |
|
|
|
# |
|
|
|
|
|
|
|
def test_platform_codes_spot_check(self): |
|
|
|
def test_platform_codes_spot_check(self): |
|
|
|
return |
|
|
|
|
|
|
|
# Asserts basic platform code parsing behavior for a few cases |
|
|
|
# Asserts basic platform code parsing behavior for a few cases |
|
|
|
results = get_platform_codes([b'\x018966306L3100\x00\x00\x00\x00']) |
|
|
|
results = get_platform_codes([b"F152607140\x00\x00\x00\x00\x00\x00"]) |
|
|
|
self.assertEqual(results, {(b"89663-06", b"L3-100")}) |
|
|
|
self.assertEqual(results, {(b"F1526-07-1", b"40")}) |
|
|
|
|
|
|
|
|
|
|
|
# Some cameras and all radars do not have dates |
|
|
|
results = get_platform_codes([b"\x028646F4104100\x00\x00\x00\x008646G5301200\x00\x00\x00\x00"]) |
|
|
|
results = get_platform_codes([b"\xf1\x00AEhe SCC H-CUP 1.01 1.01 96400-G2000 "]) |
|
|
|
self.assertEqual(results, {(b"8646F-41-04", b"100")}) |
|
|
|
self.assertEqual(results, {(b"AEhe-G2000", None)}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
results = get_platform_codes([b"\xf1\x00CV1_ RDR ----- 1.00 1.01 99110-CV000 "]) |
|
|
|
# Short version has no part number |
|
|
|
self.assertEqual(results, {(b"CV1-CV000", None)}) |
|
|
|
results = get_platform_codes([b"\x0235879000\x00\x00\x00\x00\x00\x00\x00\x00A4701000\x00\x00\x00\x00\x00\x00\x00\x00"]) |
|
|
|
|
|
|
|
self.assertEqual(results, {(b"35-87", b"9000")}) |
|
|
|
|
|
|
|
|
|
|
|
results = get_platform_codes([ |
|
|
|
results = get_platform_codes([ |
|
|
|
b"\xf1\x00DH LKAS 1.1 -150210", |
|
|
|
b"F152607140\x00\x00\x00\x00\x00\x00", |
|
|
|
b"\xf1\x00AEhe SCC H-CUP 1.01 1.01 96400-G2000 ", |
|
|
|
b"\x028646F4104100\x00\x00\x00\x008646G5301200\x00\x00\x00\x00", |
|
|
|
b"\xf1\x00CV1_ RDR ----- 1.00 1.01 99110-CV000 ", |
|
|
|
b"\x0235879000\x00\x00\x00\x00\x00\x00\x00\x00A4701000\x00\x00\x00\x00\x00\x00\x00\x00", |
|
|
|
]) |
|
|
|
]) |
|
|
|
self.assertEqual(results, {(b"DH", b"150210"), (b"AEhe-G2000", None), (b"CV1-CV000", None)}) |
|
|
|
self.assertEqual(results, {(b"F1526-07-1", b"40"), (b"8646F-41-04", b"100"), (b"35-87", b"9000")}) |
|
|
|
|
|
|
|
|
|
|
|
results = get_platform_codes([ |
|
|
|
|
|
|
|
b"\xf1\x00LX2 MFC AT USA LHD 1.00 1.07 99211-S8100 220222", |
|
|
|
|
|
|
|
b"\xf1\x00LX2 MFC AT USA LHD 1.00 1.08 99211-S8100 211103", |
|
|
|
|
|
|
|
b"\xf1\x00ON MFC AT USA LHD 1.00 1.01 99211-S9100 190405", |
|
|
|
|
|
|
|
b"\xf1\x00ON MFC AT USA LHD 1.00 1.03 99211-S9100 190720", |
|
|
|
|
|
|
|
]) |
|
|
|
|
|
|
|
self.assertEqual(results, {(b"LX2-S8100", b"220222"), (b"LX2-S8100", b"211103"), |
|
|
|
|
|
|
|
(b"ON-S9100", b"190405"), (b"ON-S9100", b"190720")}) |
|
|
|
|
|
|
|
# |
|
|
|
|
|
|
|
def test_fuzzy_excluded_platforms(self): |
|
|
|
def test_fuzzy_excluded_platforms(self): |
|
|
|
# Asserts a list of platforms that will not fuzzy fingerprint with platform codes due to them being shared. |
|
|
|
# Asserts a list of platforms that will not fuzzy fingerprint with platform codes due to them being shared. |
|
|
|
# This list can be shrunk as we combine platforms, detect features, and add the hybrid ECU |
|
|
|
# This list can be shrunk as we combine platforms, detect features, and add the hybrid ECU |
|
|
|