Skip to content

Commit

Permalink
update test case
Browse files Browse the repository at this point in the history
  • Loading branch information
deanlee committed Aug 1, 2024
1 parent 05cafd4 commit 7604621
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion opendbc/can/tests/test_packer_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ def rx_steering_msg(values, bad_checksum=False):
assert parser.vl["STEERING_CONTROL"]["STEER_TORQUE"] == 300
assert parser.vl_all["STEERING_CONTROL"]["STEER_TORQUE"] == [300]

def test_parser_empty_message(self):
parser = CANParser("toyota_nodsu_pt_generated", [("ACC_CONTROL", 0)])
addr = parser.update_strings([])
assert len(addr) == 0

def test_packer_parser(self):
msgs = [
("Brake_Status", 0),
Expand Down Expand Up @@ -264,7 +269,7 @@ def test_updated(self):
can_msgs[frame].append(packer.make_can_msg("VSA_STATUS", 0, values))
idx += 1

parser.update_strings([[0, m] for m in can_msgs])
parser.update_strings([[random.randint(0, 255), m] for m in can_msgs])
vl_all = parser.vl_all["VSA_STATUS"]["USER_BRAKE"]

assert vl_all == user_brake_vals
Expand Down

0 comments on commit 7604621

Please sign in to comment.