Skip to content

Commit

Permalink
Support multiple RMWs in test
Browse files Browse the repository at this point in the history
Signed-off-by: Kyle Fazzari <[email protected]>
  • Loading branch information
kyrofa committed Apr 8, 2020
1 parent e6aaaa3 commit 298c9c2
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@

import pytest

import rclpy
from ros2cli import cli
from sros2.api import _key, _keystore
from sros2.api import _key, _keystore, _permission


# This fixture will run once for the entire module (as opposed to once per test)
Expand Down Expand Up @@ -63,7 +64,10 @@ def test_create_permission(security_context_dir):
assert grants[0].get('name') == '/talker_listener/talker'

allow_rules = list(grants[0].iterchildren(tag='allow_rule'))
assert len(allow_rules) == 1
if rclpy.get_rmw_implementation_identifier() in _permission._RMW_WITH_ROS_GRAPH_INFO_TOPIC:
assert len(allow_rules) == 2
else:
assert len(allow_rules) == 1

publish_rules = list(allow_rules[0].iterchildren(tag='publish'))
assert len(publish_rules) == 1
Expand Down

0 comments on commit 298c9c2

Please sign in to comment.