repo_id
stringclasses
400 values
commit_sha
stringclasses
400 values
commit_index
int32
0
951
in_repo_split
stringclasses
1 value
cross_repo_split
stringclasses
1 value
test_file
stringlengths
7
121
test_function
stringlengths
1
108
assertion_type
stringclasses
32 values
difficulty
stringclasses
8 values
context_lines
int32
3
600
prefix
large_stringlengths
44
113k
target
large_stringlengths
1
498
anchor_sha
stringclasses
400 values
anchor_index
int32
0
951
qna_source
stringclasses
1 value
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/can/tests/test_packer_parser.py
test_subaru
pytest.approx
variable
34
import pytest import random from opendbc.can import CANPacker, CANParser from opendbc.can.tests import TEST_DBC MAX_BAD_COUNTER = 5 class TestCanParserPacker: def test_subaru(self): # Subaru is little endian dbc_file = "subaru_global_2017_generated" msgs = [("ES_LKAS", 50)] parser = CANParser(d...
steer)
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/tests/test_docs.py
test_naming_conventions
assert
variable
22
from collections import defaultdict import pytest from opendbc.car.car_helpers import interfaces from opendbc.car.docs import get_all_car_docs from opendbc.car.docs_definitions import Cable, Column, PartType, Star, SupportType from opendbc.car.honda.values import CAR as HONDA from opendbc.car.values import PLATFORMS ...
tokens
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/can/tests/test_packer_parser.py
test_subaru
pytest.approx
variable
35
import pytest import random from opendbc.can import CANPacker, CANParser from opendbc.can.tests import TEST_DBC MAX_BAD_COUNTER = 5 class TestCanParserPacker: def test_subaru(self): # Subaru is little endian dbc_file = "subaru_global_2017_generated" msgs = [("ES_LKAS", 50)] parser = CANParser(d...
active)
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/subaru/tests/test_subaru.py
test_fw_version_format
assert
variable
10
from opendbc.car.subaru.fingerprints import FW_VERSIONS class TestSubaruFingerprint: def test_fw_version_format(self): for platform, fws_per_ecu in FW_VERSIONS.items(): for (ecu, _, _), fws in fws_per_ecu.items(): fw_size = len(fws[0]) for fw in fws: assert len(fw) ==
fw_size
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/tests/test_vehicle_model.py
test_round_trip_yaw_rate
pytest.approx
variable
24
import pytest import math import numpy as np from opendbc.car.honda.interface import CarInterface from opendbc.car.honda.values import CAR from opendbc.car.vehicle_model import VehicleModel, dyn_ss_sol, create_dyn_state_matrices class TestVehicleModel: def setup_method(self): CP = CarInterface.get_non_essentia...
new_sa)
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/volkswagen/tests/test_volkswagen.py
test_custom_fuzzy_fingerprinting
assert
variable
38
import random import re from opendbc.car.structs import CarParams from opendbc.car.volkswagen.values import CAR, FW_QUERY_CONFIG, WMI from opendbc.car.volkswagen.fingerprints import FW_VERSIONS Ecu = CarParams.Ecu CHASSIS_CODE_PATTERN = re.compile('[A-Z0-9]{2}') SPARE_PART_FW_PATTERN = re.compile(b'\xf1\x87(?P<gate...
matches
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/hyundai/tests/test_hyundai.py
test_fuzzy_excluded_platforms
assert
variable
68
from hypothesis import settings, given, strategies as st import pytest from opendbc.car import gen_empty_fingerprint from opendbc.car.structs import CarParams from opendbc.car.fw_versions import build_fw_dict from opendbc.car.hyundai.interface import CarInterface from opendbc.car.hyundai.hyundaicanfd import CanBus fr...
platform
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/tests/test_fw_fingerprint.py
assertFingerprints
assert
variable
24
import pytest import random import time from collections import defaultdict from opendbc.car.can_definitions import CanData from opendbc.car.car_helpers import interfaces from opendbc.car.structs import CarParams from opendbc.car.fingerprints import FW_VERSIONS from opendbc.car.fw_versions import FW_QUERY_CONFIGS, FUZ...
expected
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/toyota/tests/test_toyota.py
test_fuzzy_excluded_platforms
assert
variable
34
from hypothesis import given, settings, strategies as st from opendbc.car import Bus from opendbc.car.structs import CarParams from opendbc.car.fw_versions import build_fw_dict from opendbc.car.toyota.fingerprints import FW_VERSIONS from opendbc.car.toyota.values import CAR, DBC, TSS2_CAR, ANGLE_CONTROL_CAR, RADAR_ACC...
platform
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/can/tests/test_dbc_exceptions.py
test_civic_exceptions
pytest.raises
variable
18
import pytest from opendbc.can import CANDefine, CANPacker, CANParser from opendbc.can.tests import TEST_DBC class TestCanParserPackerExceptions: def test_civic_exceptions(self): dbc_file = "honda_civic_touring_2016_can_generated" dbc_invalid = dbc_file + "abcdef" msgs = [("STEERING_CONTROL", 50)] w...
KeyError)
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/tests/test_can_fingerprint.py
test_can_fingerprint
assert
variable
19
import pytest from opendbc.car.can_definitions import CanData from opendbc.car.car_helpers import FRAME_FINGERPRINT, can_fingerprint from opendbc.car.fingerprints import _FINGERPRINTS as FINGERPRINTS class TestCanFingerprint: @pytest.mark.parametrize("car_model, fingerprints", FINGERPRINTS.items()) def test_can_fi...
car_model
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/tests/test_docs.py
test_harnesses
assert
variable
27
from collections import defaultdict import pytest from opendbc.car.car_helpers import interfaces from opendbc.car.docs import get_all_car_docs from opendbc.car.docs_definitions import Cable, Column, PartType, Star, SupportType from opendbc.car.honda.values import CAR as HONDA from opendbc.car.values import PLATFORMS ...
car_parts
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_nissan.py
test_acc_buttons
self.assertEqual
variable
78
import unittest from opendbc.car.nissan.values import NissanSafetyFlags from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda class TestNissanSafety(common.PandaCarSafetyTest...
should_tx)
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_subaru.py
test_es_uds_message
self.assertEqual
variable
62
import enum import unittest from opendbc.car.subaru.values import SubaruSafetyFlags from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda from functools import partial def lk...
should_tx)
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_tesla.py
test_no_aeb
self.assertEqual
variable
39
import random import unittest import numpy as np from opendbc.car.tesla.values import TeslaSafetyFlags from opendbc.car.tesla.carcontroller import get_max_angle_delta, get_max_angle, get_safety_CP from opendbc.car.structs import CarParams from opendbc.car.vehicle_model import VehicleModel from opendbc.can import CANDe...
should_tx)
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/can/tests/test_dbc_exceptions.py
test_civic_exceptions
pytest.raises
variable
22
import pytest from opendbc.can import CANDefine, CANPacker, CANParser from opendbc.can.tests import TEST_DBC class TestCanParserPackerExceptions: def test_civic_exceptions(self): dbc_file = "honda_civic_touring_2016_can_generated" dbc_invalid = dbc_file + "abcdef" msgs = [("STEERING_CONTROL", 50)] w...
IndexError)
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/tests/test_can_fingerprint.py
test_can_fingerprint
assert
variable
20
import pytest from opendbc.car.can_definitions import CanData from opendbc.car.car_helpers import FRAME_FINGERPRINT, can_fingerprint from opendbc.car.fingerprints import _FINGERPRINTS as FINGERPRINTS class TestCanFingerprint: @pytest.mark.parametrize("car_model, fingerprints", FINGERPRINTS.items()) def test_can_fi...
fingerprint
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/misra/test_mutation.py
test_misra_mutation
assert
variable
60
import os import glob import pytest import shutil import subprocess import tempfile import random HERE = os.path.abspath(os.path.dirname(__file__)) ROOT = os.path.join(HERE, "../../../../") IGNORED_PATHS = ( 'opendbc/safety/main.c', 'opendbc/safety/tests/', 'opendbc/safety/board/', ) mutations = [ # no mutat...
should_fail
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/hyundai/tests/test_hyundai.py
test_feature_detection
assert
variable
53
from hypothesis import settings, given, strategies as st import pytest from opendbc.car import gen_empty_fingerprint from opendbc.car.structs import CarParams from opendbc.car.fw_versions import build_fw_dict from opendbc.car.hyundai.interface import CarInterface from opendbc.car.hyundai.hyundaicanfd import CanBus fr...
lka_steering
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/rivian/tests/test_rivian.py
test_custom_fuzzy_fingerprinting
assert
variable
23
from opendbc.car.rivian.fingerprints import FW_VERSIONS from opendbc.car.rivian.values import CAR, FW_QUERY_CONFIG, WMI, ModelLine, ModelYear class TestRivian: def test_custom_fuzzy_fingerprinting(self, subtests): for platform in CAR: with subtests.test(platform=platform.name): for wmi in WMI: ...
should_match
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/toyota/tests/test_toyota.py
test_essential_ecus
assert
variable
31
from hypothesis import given, settings, strategies as st from opendbc.car import Bus from opendbc.car.structs import CarParams from opendbc.car.fw_versions import build_fw_dict from opendbc.car.toyota.fingerprints import FW_VERSIONS from opendbc.car.toyota.values import CAR, DBC, TSS2_CAR, ANGLE_CONTROL_CAR, RADAR_ACC...
present_ecus
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_toyota.py
test_angle_measurements
self.assertEqual
variable
53
import numpy as np import random import unittest import itertools from opendbc.car.toyota.values import ToyotaSafetyFlags from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda...
final_angle)
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/ford/tests/test_ford.py
test_fw_query_config
assert
variable
44
import random from collections.abc import Iterable from hypothesis import settings, given, strategies as st from parameterized import parameterized from opendbc.car.structs import CarParams from opendbc.car.fw_versions import build_fw_dict from opendbc.car.ford.values import CAR, FW_QUERY_CONFIG, FW_PATTERN, get_plat...
ECU_ADDRESSES
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/tests/test_fw_fingerprint.py
test_custom_fuzzy_match
assert
variable
46
import pytest import random import time from collections import defaultdict from opendbc.car.can_definitions import CanData from opendbc.car.car_helpers import interfaces from opendbc.car.structs import CarParams from opendbc.car.fingerprints import FW_VERSIONS from opendbc.car.fw_versions import FW_QUERY_CONFIGS, FUZ...
brand_matches
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/common.py
test_rx_hook_speed_mismatch
self.assertEqual
variable
103
import os import abc import math import unittest import importlib import numpy as np from collections.abc import Callable from opendbc.can import CANPacker from opendbc.safety import ALTERNATIVE_EXPERIENCE from opendbc.safety.tests.libsafety import libsafety_py MAX_WRONG_COUNTERS = 5 MAX_SAMPLE_VALS = 6 VEHICLE_SPEED...
within_delta)
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_tesla.py
test_rx_hook_speed_mismatch
self.assertEqual
variable
139
import random import unittest import numpy as np from opendbc.car.tesla.values import TeslaSafetyFlags from opendbc.car.tesla.carcontroller import get_max_angle_delta, get_max_angle, get_safety_CP from opendbc.car.structs import CarParams from opendbc.car.vehicle_model import VehicleModel from opendbc.can import CANDe...
within_delta)
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/can/tests/test_packer_parser.py
test_packer_counter
assert
complex_expr
21
import pytest import random from opendbc.can import CANPacker, CANParser from opendbc.can.tests import TEST_DBC MAX_BAD_COUNTER = 5 class TestCanParserPacker: def test_packer_counter(self): msgs = [("CAN_FD_MESSAGE", 0), ] packer = CANPacker(TEST_DBC) parser = CANParser(TEST_DBC, msgs, 0) # packe...
i % 256
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/misra/test_mutation.py
test_misra_mutation
assert
complex_expr
62
import os import glob import pytest import shutil import subprocess import tempfile import random HERE = os.path.abspath(os.path.dirname(__file__)) ROOT = os.path.join(HERE, "../../../../") IGNORED_PATHS = ( 'opendbc/safety/main.c', 'opendbc/safety/tests/', 'opendbc/safety/board/', ) mutations = [ # no mutat...
r.stdout
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/tests/test_docs.py
test_naming_conventions
assert
complex_expr
25
from collections import defaultdict import pytest from opendbc.car.car_helpers import interfaces from opendbc.car.docs import get_all_car_docs from opendbc.car.docs_definitions import Cable, Column, PartType, Star, SupportType from opendbc.car.honda.values import CAR as HONDA from opendbc.car.values import PLATFORMS ...
car.model
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/tests/test_docs.py
test_torque_star
assert
complex_expr
22
from collections import defaultdict import pytest from opendbc.car.car_helpers import interfaces from opendbc.car.docs import get_all_car_docs from opendbc.car.docs_definitions import Cable, Column, PartType, Star, SupportType from opendbc.car.honda.values import CAR as HONDA from opendbc.car.values import PLATFORMS ...
Star.EMPTY
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/common.py
test_gas_brake_limits_correct
self.assertGreater
complex_expr
76
import os import abc import math import unittest import importlib import numpy as np from collections.abc import Callable from opendbc.can import CANPacker from opendbc.safety import ALTERNATIVE_EXPERIENCE from opendbc.safety.tests.libsafety import libsafety_py MAX_WRONG_COUNTERS = 5 MAX_SAMPLE_VALS = 6 VEHICLE_SPEED...
self.MIN_GAS)
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_toyota.py
test_angle_measurements
self.assertEqual
complex_expr
52
import numpy as np import random import unittest import itertools from opendbc.car.toyota.values import ToyotaSafetyFlags from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda...
-final_angle)
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/common.py
test_gas_brake_limits_correct
self.assertGreater
complex_expr
75
import os import abc import math import unittest import importlib import numpy as np from collections.abc import Callable from opendbc.can import CANPacker from opendbc.safety import ALTERNATIVE_EXPERIENCE from opendbc.safety.tests.libsafety import libsafety_py MAX_WRONG_COUNTERS = 5 MAX_SAMPLE_VALS = 6 VEHICLE_SPEED...
self.MIN_BRAKE)
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_tesla.py
test_no_aeb
self.assertEqual
complex_expr
37
import random import unittest import numpy as np from opendbc.car.tesla.values import TeslaSafetyFlags from opendbc.car.tesla.carcontroller import get_max_angle_delta, get_max_angle, get_safety_CP from opendbc.car.structs import CarParams from opendbc.car.vehicle_model import VehicleModel from opendbc.can import CANDe...
aeb_event == 0)
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/tests/test_fw_fingerprint.py
test_blacklisted_ecus
assert
complex_expr
39
import pytest import random import time from collections import defaultdict from opendbc.car.can_definitions import CanData from opendbc.car.car_helpers import interfaces from opendbc.car.structs import CarParams from opendbc.car.fingerprints import FW_VERSIONS from opendbc.car.fw_versions import FW_QUERY_CONFIGS, FUZ...
Ecu.transmission
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/ford/tests/test_ford.py
test_fw_query_config
assert
complex_expr
45
import random from collections.abc import Iterable from hypothesis import settings, given, strategies as st from parameterized import parameterized from opendbc.car.structs import CarParams from opendbc.car.fw_versions import build_fw_dict from opendbc.car.ford.values import CAR, FW_QUERY_CONFIG, FW_PATTERN, get_plat...
ECU_ADDRESSES[ecu]
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/tests/test_can_fingerprint.py
test_timing
assert
complex_expr
40
import pytest from opendbc.car.can_definitions import CanData from opendbc.car.car_helpers import FRAME_FINGERPRINT, can_fingerprint from opendbc.car.fingerprints import _FINGERPRINTS as FINGERPRINTS class TestCanFingerprint: def test_timing(self, subtests): # just pick any CAN fingerprinting car car_model ...
expected_frames + 2
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/tests/test_fw_fingerprint.py
_assert_timing
assert
complex_expr
58
import pytest import random import time from collections import defaultdict from opendbc.car.can_definitions import CanData from opendbc.car.car_helpers import interfaces from opendbc.car.structs import CarParams from opendbc.car.fingerprints import FW_VERSIONS from opendbc.car.fw_versions import FW_QUERY_CONFIGS, FUZ...
ref_time + self.TOL
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/tests/test_fw_fingerprint.py
_assert_timing
assert
complex_expr
59
import pytest import random import time from collections import defaultdict from opendbc.car.can_definitions import CanData from opendbc.car.car_helpers import interfaces from opendbc.car.structs import CarParams from opendbc.car.fingerprints import FW_VERSIONS from opendbc.car.fw_versions import FW_QUERY_CONFIGS, FUZ...
ref_time - self.TOL
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/can/tests/test_define.py
test_civic
assert
complex_expr
11
from opendbc.can import CANDefine from opendbc.can.tests import ALL_DBCS class TestCANDefine: def test_civic(self): dbc_file = "honda_civic_touring_2016_can_generated" defs = CANDefine(dbc_file) assert defs.dv[399] ==
defs.dv['STEER_STATUS']
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/tests/test_fw_fingerprint.py
test_brand_ecu_matches
assert
complex_expr
33
import pytest import random import time from collections import defaultdict from opendbc.car.can_definitions import CanData from opendbc.car.car_helpers import interfaces from opendbc.car.structs import CarParams from opendbc.car.fingerprints import FW_VERSIONS from opendbc.car.fw_versions import FW_QUERY_CONFIGS, FUZ...
brand_matches['toyota']
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/can/tests/test_checksums.py
verify_checksum
assert
complex_expr
28
import copy from opendbc.can import CANPacker, CANParser class TestCanChecksums: def verify_checksum(self, subtests, dbc_file: str, msg_name: str, msg_addr: int, test_messages: list[bytes], checksum_field: str = 'CHECKSUM', counter_field = 'COUNTER'): """ Verify that opendbc calculates...
expected[checksum_field]
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/tests/test_car_interfaces.py
test_car_interfaces
assert
complex_expr
72
import os import math import hypothesis.strategies as st import pytest from hypothesis import Phase, given, settings from collections.abc import Callable from typing import Any from opendbc.car import DT_CTRL, CanData, structs from opendbc.car.car_helpers import interfaces from opendbc.car.fingerprints import FW_VERSI...
car_params.centerToFront
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/tests/test_docs.py
test_duplicate_years
assert
complex_expr
25
from collections import defaultdict import pytest from opendbc.car.car_helpers import interfaces from opendbc.car.docs import get_all_car_docs from opendbc.car.docs_definitions import Cable, Column, PartType, Star, SupportType from opendbc.car.honda.values import CAR as HONDA from opendbc.car.values import PLATFORMS ...
make_model_years[make_model]
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/can/tests/test_packer_parser.py
test_parser_no_partial_update
assert
collection
41
import pytest import random from opendbc.can import CANPacker, CANParser from opendbc.can.tests import TEST_DBC MAX_BAD_COUNTER = 5 class TestCanParserPacker: def test_parser_no_partial_update(self): """ Ensure that the CANParser doesn't partially update messages with invalid signals (COUNTER/CHECKSUM). ...
[]
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/tests/test_can_fingerprint.py
test_can_fingerprint
assert
collection
22
import pytest from opendbc.car.can_definitions import CanData from opendbc.car.car_helpers import FRAME_FINGERPRINT, can_fingerprint from opendbc.car.fingerprints import _FINGERPRINTS as FINGERPRINTS class TestCanFingerprint: @pytest.mark.parametrize("car_model, fingerprints", FINGERPRINTS.items()) def test_can_fi...
{}
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/can/tests/test_packer_parser.py
test_timestamp_nanos
assert
collection
27
import pytest import random from opendbc.can import CANPacker, CANParser from opendbc.can.tests import TEST_DBC MAX_BAD_COUNTER = 5 class TestCanParserPacker: def test_timestamp_nanos(self): """Test message timestamp dict""" dbc_file = "honda_civic_touring_2016_can_generated" msgs = [ ("VSA_STA...
{0}
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/can/tests/test_packer_parser.py
test_parser_updated_list
assert
collection
19
import pytest import random from opendbc.can import CANPacker, CANParser from opendbc.can.tests import TEST_DBC MAX_BAD_COUNTER = 5 class TestCanParserPacker: def test_parser_updated_list(self): msgs = [("CAN_FD_MESSAGE", 10), ] parser = CANParser(TEST_DBC, msgs, 0) packer = CANPacker(TEST_DBC) m...
{245}
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/can/tests/test_packer_parser.py
test_parser_no_partial_update
assert
collection
36
import pytest import random from opendbc.can import CANPacker, CANParser from opendbc.can.tests import TEST_DBC MAX_BAD_COUNTER = 5 class TestCanParserPacker: def test_parser_no_partial_update(self): """ Ensure that the CANParser doesn't partially update messages with invalid signals (COUNTER/CHECKSUM). ...
[100]
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/ford/tests/test_ford.py
test_fuzzy_match
assert
collection
56
import random from collections.abc import Iterable from hypothesis import settings, given, strategies as st from parameterized import parameterized from opendbc.car.structs import CarParams from opendbc.car.fw_versions import build_fw_dict from opendbc.car.ford.values import CAR, FW_QUERY_CONFIG, FW_PATTERN, get_plat...
{platform}
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/hyundai/tests/test_hyundai.py
test_expected_platform_codes
assert
collection
57
from hypothesis import settings, given, strategies as st import pytest from opendbc.car import gen_empty_fingerprint from opendbc.car.structs import CarParams from opendbc.car.fw_versions import build_fw_dict from opendbc.car.hyundai.interface import CarInterface from opendbc.car.hyundai.hyundaicanfd import CanBus fr...
{b"LX", b"ON"}
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/hyundai/tests/test_hyundai.py
test_expected_platform_codes
assert
collection
59
from hypothesis import settings, given, strategies as st import pytest from opendbc.car import gen_empty_fingerprint from opendbc.car.structs import CarParams from opendbc.car.fw_versions import build_fw_dict from opendbc.car.hyundai.interface import CarInterface from opendbc.car.hyundai.hyundaicanfd import CanBus fr...
{b"OE", b"OS"}
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/hyundai/tests/test_hyundai.py
test_platform_codes_spot_check
assert
collection
49
from hypothesis import settings, given, strategies as st import pytest from opendbc.car import gen_empty_fingerprint from opendbc.car.structs import CarParams from opendbc.car.fw_versions import build_fw_dict from opendbc.car.hyundai.interface import CarInterface from opendbc.car.hyundai.hyundaicanfd import CanBus fr...
{(b"DH", b"150210")}
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/hyundai/tests/test_hyundai.py
test_platform_code_ecus_available
assert
collection
59
from hypothesis import settings, given, strategies as st import pytest from opendbc.car import gen_empty_fingerprint from opendbc.car.structs import CarParams from opendbc.car.fw_versions import build_fw_dict from opendbc.car.hyundai.interface import CarInterface from opendbc.car.hyundai.hyundaicanfd import CanBus fr...
[e[0] for e in ecus]
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/toyota/tests/test_toyota.py
test_platform_code_ecus_available
assert
collection
29
from hypothesis import given, settings, strategies as st from opendbc.car import Bus from opendbc.car.structs import CarParams from opendbc.car.fw_versions import build_fw_dict from opendbc.car.toyota.fingerprints import FW_VERSIONS from opendbc.car.toyota.values import CAR, DBC, TSS2_CAR, ANGLE_CONTROL_CAR, RADAR_ACC...
[e[0] for e in ecus]
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/ford/tests/test_ford.py
test_match_fw_fuzzy
assert
collection
73
import random from collections.abc import Iterable from hypothesis import settings, given, strategies as st from parameterized import parameterized from opendbc.car.structs import CarParams from opendbc.car.fw_versions import build_fw_dict from opendbc.car.ford.values import CAR, FW_QUERY_CONFIG, FW_PATTERN, get_plat...
{expected_fingerprint}
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/hyundai/tests/test_hyundai.py
test_platform_codes_spot_check
assert
collection
56
from hypothesis import settings, given, strategies as st import pytest from opendbc.car import gen_empty_fingerprint from opendbc.car.structs import CarParams from opendbc.car.fw_versions import build_fw_dict from opendbc.car.hyundai.interface import CarInterface from opendbc.car.hyundai.hyundaicanfd import CanBus fr...
{(b"CV1-CV000", None)}
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/hyundai/tests/test_hyundai.py
test_platform_codes_spot_check
assert
collection
53
from hypothesis import settings, given, strategies as st import pytest from opendbc.car import gen_empty_fingerprint from opendbc.car.structs import CarParams from opendbc.car.fw_versions import build_fw_dict from opendbc.car.hyundai.interface import CarInterface from opendbc.car.hyundai.hyundaicanfd import CanBus fr...
{(b"AEhe-G2000", None)}
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/toyota/tests/test_toyota.py
test_platform_codes_spot_check
assert
collection
34
from hypothesis import given, settings, strategies as st from opendbc.car import Bus from opendbc.car.structs import CarParams from opendbc.car.fw_versions import build_fw_dict from opendbc.car.toyota.fingerprints import FW_VERSIONS from opendbc.car.toyota.values import CAR, DBC, TSS2_CAR, ANGLE_CONTROL_CAR, RADAR_ACC...
{b"8646F-41-04": {b"100"}}
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_honda.py
test_brake_safety_check
self.assertEqual
collection
45
import unittest import numpy as np from opendbc.car.honda.values import HondaSafetyFlags from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.car.structs import CarParams from opendbc.safety.tests.common import CANPackerPanda, MAX_WRONG_COUNTERS HONDA_N_COM...
(controls_allowed, accel))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_volkswagen_mqb.py
test_accel_safety_check
self.assertEqual
collection
46
import unittest import numpy as np from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda from opendbc.car.volkswagen.values import VolkswagenSafetyFlags MAX_ACCEL = 2.0 MIN_AC...
(controls_allowed, accel))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/toyota/tests/test_toyota.py
test_lta_platforms
assert
collection
22
from hypothesis import given, settings, strategies as st from opendbc.car import Bus from opendbc.car.structs import CarParams from opendbc.car.fw_versions import build_fw_dict from opendbc.car.toyota.fingerprints import FW_VERSIONS from opendbc.car.toyota.values import CAR, DBC, TSS2_CAR, ANGLE_CONTROL_CAR, RADAR_ACC...
{CAR.TOYOTA_RAV4_TSS2_2023}
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/tests/test_fw_fingerprint.py
test_request_ecus_in_versions
assert
collection
33
import pytest import random import time from collections import defaultdict from opendbc.car.can_definitions import CanData from opendbc.car.car_helpers import interfaces from opendbc.car.structs import CarParams from opendbc.car.fingerprints import FW_VERSIONS from opendbc.car.fw_versions import FW_QUERY_CONFIGS, FUZ...
{e for e, _, _ in version_ecus}
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_honda.py
test_gas_safety_check
self.assertEqual
collection
45
import unittest import numpy as np from opendbc.car.honda.values import HondaSafetyFlags from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.car.structs import CarParams from opendbc.safety.tests.common import CANPackerPanda, MAX_WRONG_COUNTERS HONDA_N_COM...
(controls_allowed, gas, accel))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/toyota/tests/test_toyota.py
test_platform_codes_spot_check
assert
collection
41
from hypothesis import given, settings, strategies as st from opendbc.car import Bus from opendbc.car.structs import CarParams from opendbc.car.fw_versions import build_fw_dict from opendbc.car.toyota.fingerprints import FW_VERSIONS from opendbc.car.toyota.values import CAR, DBC, TSS2_CAR, ANGLE_CONTROL_CAR, RADAR_ACC...
{b"58-70": {b"000"}, b"58-83": {b"000"}}
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/ford/tests/test_ford.py
test_fw_query_config
assert
none_literal
46
import random from collections.abc import Iterable from hypothesis import settings, given, strategies as st from parameterized import parameterized from opendbc.car.structs import CarParams from opendbc.car.fw_versions import build_fw_dict from opendbc.car.ford.values import CAR, FW_QUERY_CONFIG, FW_PATTERN, get_plat...
None
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/honda/tests/test_honda.py
test_fw_version_format
assert
none_literal
14
import re from opendbc.car.honda.fingerprints import FW_VERSIONS HONDA_FW_VERSION_RE = br"[A-Z0-9]{5}-[A-Z0-9]{3}(-|,)[A-Z0-9]{4}(\x00){2}$" class TestHondaFingerprint: def test_fw_version_format(self): # Asserts all FW versions follow an expected format for fw_by_ecu in FW_VERSIONS.values(): for fws...
None
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/tests/test_platform_configs.py
test_configs
assert
none_literal
17
from opendbc.car.values import PLATFORMS class TestPlatformConfigs: def test_configs(self, subtests): for name, platform in PLATFORMS.items(): with subtests.test(platform=str(platform)): assert platform.config._frozen if platform != "MOCK": assert len(platform.config.dbc_dict) >...
None
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/hyundai/tests/test_hyundai.py
test_can_features
assert
func_call
48
from hypothesis import settings, given, strategies as st import pytest from opendbc.car import gen_empty_fingerprint from opendbc.car.structs import CarParams from opendbc.car.fw_versions import build_fw_dict from opendbc.car.hyundai.interface import CarInterface from opendbc.car.hyundai.hyundaicanfd import CanBus fr...
set()
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/ford/tests/test_ford.py
test_fw_versions
assert
func_call
60
import random from collections.abc import Iterable from hypothesis import settings, given, strategies as st from parameterized import parameterized from opendbc.car.structs import CarParams from opendbc.car.fw_versions import build_fw_dict from opendbc.car.ford.values import CAR, FW_QUERY_CONFIG, FW_PATTERN, get_plat...
len(codes)
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/hyundai/tests/test_hyundai.py
test_fw_format
assert
func_call
61
from hypothesis import settings, given, strategies as st import pytest from opendbc.car import gen_empty_fingerprint from opendbc.car.structs import CarParams from opendbc.car.fw_versions import build_fw_dict from opendbc.car.hyundai.interface import CarInterface from opendbc.car.hyundai.hyundaicanfd import CanBus fr...
len(result)
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/toyota/tests/test_toyota.py
test_fw_format
assert
func_call
36
from hypothesis import given, settings, strategies as st from opendbc.car import Bus from opendbc.car.structs import CarParams from opendbc.car.fw_versions import build_fw_dict from opendbc.car.toyota.fingerprints import FW_VERSIONS from opendbc.car.toyota.values import CAR, DBC, TSS2_CAR, ANGLE_CONTROL_CAR, RADAR_ACC...
len(result)
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/common.py
test_tx_hook_on_wrong_safety_mode
self.assertFalse
func_call
149
import os import abc import math import unittest import importlib import numpy as np from collections.abc import Callable from opendbc.can import CANPacker from opendbc.safety import ALTERNATIVE_EXPERIENCE from opendbc.safety.tests.libsafety import libsafety_py MAX_WRONG_COUNTERS = 5 MAX_SAMPLE_VALS = 6 VEHICLE_SPEED...
self._tx(msg))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_ford.py
test_rx_hook
self.assertEqual
func_call
196
import numpy as np import random import unittest import opendbc.safety.tests.common as common from opendbc.car.ford.carcontroller import MAX_LATERAL_ACCEL from opendbc.car.ford.values import FordSafetyFlags from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py from opendbc.s...
self._rx(msg))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_honda.py
test_rx_hook
self.assertTrue
func_call
27
import unittest import numpy as np from opendbc.car.honda.values import HondaSafetyFlags from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.car.structs import CarParams from opendbc.safety.tests.common import CANPackerPanda, MAX_WRONG_COUNTERS HONDA_N_COM...
self._rx(msg))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_rivian.py
test_rx_hook
self.assertFalse
func_call
95
import unittest from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda from opendbc.car.rivian.values import RivianSafetyFlags from opendbc.car.rivian.riviancan import checksum...
self._rx(msg))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_tesla.py
test_user_brake_quality_flag
self.assertEqual
func_call
126
import random import unittest import numpy as np from opendbc.car.tesla.values import TeslaSafetyFlags from opendbc.car.tesla.carcontroller import get_max_angle_delta, get_max_angle, get_safety_CP from opendbc.car.structs import CarParams from opendbc.car.vehicle_model import VehicleModel from opendbc.can import CANDe...
self._rx(msg))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_toyota.py
test_rx_hook
self.assertTrue
func_call
82
import numpy as np import random import unittest import itertools from opendbc.car.toyota.values import ToyotaSafetyFlags from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda...
self._rx(msg))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_toyota.py
test_block_aeb
self.assertEqual
func_call
83
import numpy as np import random import unittest import itertools from opendbc.car.toyota.values import ToyotaSafetyFlags from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda...
self._tx(msg))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/tests/test_vehicle_model.py
test_dyn_ss_sol_against_yaw_rate
assert
func_call
29
import pytest import math import numpy as np from opendbc.car.honda.interface import CarInterface from opendbc.car.honda.values import CAR from opendbc.car.vehicle_model import VehicleModel, dyn_ss_sol, create_dyn_state_matrices class TestVehicleModel: def setup_method(self): CP = CarInterface.get_non_essentia...
pytest.approx(yr2)
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/tests/test_vehicle_model.py
test_round_trip_yaw_rate
assert
func_call
24
import pytest import math import numpy as np from opendbc.car.honda.interface import CarInterface from opendbc.car.honda.values import CAR from opendbc.car.vehicle_model import VehicleModel, dyn_ss_sol, create_dyn_state_matrices class TestVehicleModel: def setup_method(self): CP = CarInterface.get_non_essentia...
pytest.approx(new_sa)
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_tesla.py
test_stock_aeb_no_cancel
self.assertTrue
func_call
45
import random import unittest import numpy as np from opendbc.car.tesla.values import TeslaSafetyFlags from opendbc.car.tesla.carcontroller import get_max_angle_delta, get_max_angle, get_safety_CP from opendbc.car.structs import CarParams from opendbc.car.vehicle_model import VehicleModel from opendbc.can import CANDe...
self._tx(no_aeb_msg))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/tests/test_fw_fingerprint.py
test_missing_versions_and_configs
assert
func_call
40
import pytest import random import time from collections import defaultdict from opendbc.car.can_definitions import CanData from opendbc.car.car_helpers import interfaces from opendbc.car.structs import CarParams from opendbc.car.fingerprints import FW_VERSIONS from opendbc.car.fw_versions import FW_QUERY_CONFIGS, FUZ...
set(config.extra_ecus)
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_tesla.py
test_stock_lkas_passthrough
self.assertTrue
func_call
132
import random import unittest import numpy as np from opendbc.car.tesla.values import TeslaSafetyFlags from opendbc.car.tesla.carcontroller import get_max_angle_delta, get_max_angle, get_safety_CP from opendbc.car.structs import CarParams from opendbc.car.vehicle_model import VehicleModel from opendbc.can import CANDe...
self._tx(no_lkas_msg))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_tesla.py
test_stock_aeb_no_cancel
self.assertEqual
func_call
48
import random import unittest import numpy as np from opendbc.car.tesla.values import TeslaSafetyFlags from opendbc.car.tesla.carcontroller import get_max_angle_delta, get_max_angle, get_safety_CP from opendbc.car.structs import CarParams from opendbc.car.vehicle_model import VehicleModel from opendbc.can import CANDe...
self._rx(aeb_msg_cam))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_tesla.py
test_stock_lkas_passthrough
self.assertEqual
func_call
135
import random import unittest import numpy as np from opendbc.car.tesla.values import TeslaSafetyFlags from opendbc.car.tesla.carcontroller import get_max_angle_delta, get_max_angle, get_safety_CP from opendbc.car.structs import CarParams from opendbc.car.vehicle_model import VehicleModel from opendbc.can import CANDe...
self._rx(lkas_msg_cam))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/hyundai_common.py
test_tester_present_allowed
self.assertEqual
func_call
34
import unittest import opendbc.safety.tests.common as common from opendbc.safety.tests.libsafety import libsafety_py from opendbc.safety.tests.common import make_msg class HyundaiLongitudinalBase(common.LongitudinalAccelSafetyTest): DISABLED_ECU_UDS_MSG: tuple[int, int] DISABLED_ECU_ACTUATION_MSG: tuple[int, int...
self._tx(tester_present))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_honda.py
test_diagnostics
self.assertTrue
func_call
41
import unittest import numpy as np from opendbc.car.honda.values import HondaSafetyFlags from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.car.structs import CarParams from opendbc.safety.tests.common import CANPackerPanda, MAX_WRONG_COUNTERS HONDA_N_COM...
self._tx(tester_present))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_tesla.py
test_stock_aeb_no_cancel
self.assertEqual
func_call
43
import random import unittest import numpy as np from opendbc.car.tesla.values import TeslaSafetyFlags from opendbc.car.tesla.carcontroller import get_max_angle_delta, get_max_angle, get_safety_CP from opendbc.car.structs import CarParams from opendbc.car.vehicle_model import VehicleModel from opendbc.can import CANDe...
self._rx(no_aeb_msg_cam))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_toyota.py
test_diagnostics
self.assertEqual
func_call
79
import numpy as np import random import unittest import itertools from opendbc.car.toyota.values import ToyotaSafetyFlags from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda...
self._tx(tester_present))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_tesla.py
test_stock_lkas_passthrough
self.assertEqual
func_call
130
import random import unittest import numpy as np from opendbc.car.tesla.values import TeslaSafetyFlags from opendbc.car.tesla.carcontroller import get_max_angle_delta, get_max_angle, get_safety_CP from opendbc.car.structs import CarParams from opendbc.car.vehicle_model import VehicleModel from opendbc.can import CANDe...
self._rx(no_lkas_msg_cam))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_hyundai.py
test_no_aeb_fca11
self.assertTrue
func_call
80
import random import unittest from opendbc.car.hyundai.values import HyundaiSafetyFlags from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda from opendbc.safety.tests.hyundai...
self._tx(self._fca11_msg()))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/car/toyota/tests/test_toyota.py
test_fw_format
assert
func_call
37
from hypothesis import given, settings, strategies as st from opendbc.car import Bus from opendbc.car.structs import CarParams from opendbc.car.fw_versions import build_fw_dict from opendbc.car.toyota.fingerprints import FW_VERSIONS from opendbc.car.toyota.values import CAR, DBC, TSS2_CAR, ANGLE_CONTROL_CAR, RADAR_ACC...
len(list(result.values())[0])
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_honda.py
test_rx_hook
self.assertFalse
func_call
49
import unittest import numpy as np from opendbc.car.honda.values import HondaSafetyFlags from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.car.structs import CarParams from opendbc.safety.tests.common import CANPackerPanda, MAX_WRONG_COUNTERS HONDA_N_COM...
self._rx(self._speed_msg(0)))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_honda.py
test_diagnostics
self.assertFalse
func_call
44
import unittest import numpy as np from opendbc.car.honda.values import HondaSafetyFlags from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.car.structs import CarParams from opendbc.safety.tests.common import CANPackerPanda, MAX_WRONG_COUNTERS HONDA_N_COM...
self._tx(not_tester_present))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_hyundai.py
test_no_aeb_scc12
self.assertTrue
func_call
80
import random import unittest from opendbc.car.hyundai.values import HyundaiSafetyFlags from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda from opendbc.safety.tests.hyundai...
self._tx(self._accel_msg(0)))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_tesla.py
test_rx_hook_speed_mismatch
self.assertTrue
func_call
144
import random import unittest import numpy as np from opendbc.car.tesla.values import TeslaSafetyFlags from opendbc.car.tesla.carcontroller import get_max_angle_delta, get_max_angle, get_safety_CP from opendbc.car.structs import CarParams from opendbc.car.vehicle_model import VehicleModel from opendbc.can import CANDe...
self._rx(self._speed_msg(0)))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_gm.py
test_buttons
self.assertFalse
func_call
27
import unittest from opendbc.car.gm.values import GMSafetyFlags from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda class TestGmCameraSafety(TestGmCameraSafetyBase): TX_M...
self._tx(self._button_msg(btn)))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_honda.py
test_rx_hook
self.assertFalse
func_call
50
import unittest import numpy as np from opendbc.car.honda.values import HondaSafetyFlags from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.car.structs import CarParams from opendbc.safety.tests.common import CANPackerPanda, MAX_WRONG_COUNTERS HONDA_N_COM...
self._rx(self._user_gas_msg(0)))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor
commaai/opendbc
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
train
train
opendbc/safety/tests/test_hyundai_canfd.py
test_button_sends
self.assertFalse
func_call
51
from parameterized import parameterized_class import unittest from opendbc.car.hyundai.values import HyundaiSafetyFlags from opendbc.car.structs import CarParams from opendbc.safety.tests.libsafety import libsafety_py import opendbc.safety.tests.common as common from opendbc.safety.tests.common import CANPackerPanda f...
self._tx(self._button_msg(btn)))
698ca0ad710d8f9e66f432cde41aec59c97e9745
205
v2_extractor_at_anchor