Skip to content

Commit

Permalink
Test num_events in NumberOfEntities
Browse files Browse the repository at this point in the history
Signed-off-by: Emerson Knapp <eknapp@amazon.com>
  • Loading branch information
Emerson Knapp committed Apr 24, 2019
1 parent 41854b5 commit 8dea930
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions rclpy/test/test_waitable.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,21 +380,23 @@ def test_waitable_with_mutually_exclusive_callback_group(self):
class TestNumberOfEntities(unittest.TestCase):

def test_add(self):
n1 = NumberOfEntities(1, 2, 3, 4, 5)
n2 = NumberOfEntities(10, 20, 30, 40, 50)
n1 = NumberOfEntities(1, 2, 3, 4, 5, 6)
n2 = NumberOfEntities(10, 20, 30, 40, 50, 60)
n = n1 + n2
assert n.num_subscriptions == 11
assert n.num_guard_conditions == 22
assert n.num_timers == 33
assert n.num_clients == 44
assert n.num_services == 55
assert n.num_events == 66

def test_add_assign(self):
n1 = NumberOfEntities(1, 2, 3, 4, 5)
n2 = NumberOfEntities(10, 20, 30, 40, 50)
n1 = NumberOfEntities(1, 2, 3, 4, 5, 6)
n2 = NumberOfEntities(10, 20, 30, 40, 50, 60)
n1 += n2
assert n1.num_subscriptions == 11
assert n1.num_guard_conditions == 22
assert n1.num_timers == 33
assert n1.num_clients == 44
assert n1.num_services == 55
assert n1.num_events == 66

0 comments on commit 8dea930

Please sign in to comment.