Skip to content

Commit

Permalink
Revise steering_command_driver_test.py
Browse files Browse the repository at this point in the history
  • Loading branch information
soonho-tri committed May 8, 2018
1 parent 705e72b commit f97cd3d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 2 additions & 4 deletions automotive/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,13 @@ load(
)
load(
"@drake//tools/skylark:drake_py.bzl",
"drake_py_binary",
"drake_py_unittest",
)
load(
"@drake//tools/skylark:drake_java.bzl",
"drake_java_binary",
)
load(
"@drake//tools/skylark:drake_py.bzl",
"drake_py_binary",
)
load(
"@drake//tools/vector_gen:vector_gen.bzl",
"drake_cc_vector_gen_library",
Expand Down Expand Up @@ -802,6 +799,7 @@ drake_cc_googletest(

drake_py_unittest(
name = "steering_command_driver_test",
flaky = 1,
deps = [
":steering_command_driver",
"@lcm//:lcm-python",
Expand Down
3 changes: 3 additions & 0 deletions automotive/test/steering_command_driver_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ def __init__(self, *args, **kwargs):
self.lcm_tag = "EXAMPLE"
self.acceleration = 0.5
self.steering_angle = 0.2
self.is_handler_run = False

def handler(self, channel, data):
msg = lcm_msg.decode(data)
self.assertEqual(msg.acceleration, self.acceleration)
self.assertEqual(msg.steering_angle, self.steering_angle)
self.is_handler_run = True

def test_make_driving_command(self):
receiver = lcm.LCM()
Expand All @@ -26,3 +28,4 @@ def test_make_driving_command(self):
self.steering_angle).encode())
receiver.handle()
receiver.unsubscribe(subscription)
self.assertTrue(self.is_handler_run)

0 comments on commit f97cd3d

Please sign in to comment.