Skip to content

Commit

Permalink
address PR comments
Browse files Browse the repository at this point in the history
Signed-off-by: Miaofei <miaofei@amazon.com>
  • Loading branch information
mm318 committed Dec 18, 2019
1 parent d85917f commit 140e9d3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
9 changes: 5 additions & 4 deletions rclpy/rclpy/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -1647,10 +1647,11 @@ def assert_liveliness(self) -> None:
_rclpy.rclpy_assert_liveliness(capsule)

def _get_info_by_topic(
self,
topic_name: str,
no_mangle: bool,
func: Callable[[object, str, bool], List[Dict]]) -> List[Dict]:
self,
topic_name: str,
no_mangle: bool,
func: Callable[[object, str, bool], List[Dict]]
) -> List[Dict]:
fq_topic_name = expand_topic_name(topic_name, self.get_name(), self.get_namespace())
validate_topic_name(fq_topic_name)
with self.handle as node_capsule:
Expand Down
8 changes: 3 additions & 5 deletions rclpy/test/test_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def test_get_publishers_subscriptions_info_by_topic(self):
# Verify publisher list has the right data
self.assertEqual(self.node.get_name(), publisher_list[0].get('node_name'))
self.assertEqual(self.node.get_namespace(), publisher_list[0].get('node_namespace'))
self.assertEqual('test_msgs::msg::dds_::BasicTypes_', publisher_list[0].get('topic_type'))
self.assertEqual('test_msgs/msg/BasicTypes', publisher_list[0].get('topic_type'))
actual_qos_profile = publisher_list[0].get('qos_profile')
self.assert_qos_equal(qos_profile, actual_qos_profile)

Expand All @@ -245,10 +245,8 @@ def test_get_publishers_subscriptions_info_by_topic(self):
# Verify subscription list has the right data
self.assertEqual(self.node.get_name(), publisher_list[0].get('node_name'))
self.assertEqual(self.node.get_namespace(), publisher_list[0].get('node_namespace'))
self.assertEqual('test_msgs::msg::dds_::BasicTypes_',
publisher_list[0].get('topic_type'))
self.assertEqual('test_msgs::msg::dds_::BasicTypes_',
subscription_list[0].get('topic_type'))
self.assertEqual('test_msgs/msg/BasicTypes', publisher_list[0].get('topic_type'))
self.assertEqual('test_msgs/msg/BasicTypes', subscription_list[0].get('topic_type'))
publisher_qos_profile = publisher_list[0].get('qos_profile')
subscription_qos_profile = subscription_list[0].get('qos_profile')
self.assert_qos_equal(qos_profile, publisher_qos_profile)
Expand Down

0 comments on commit 140e9d3

Please sign in to comment.