moveit2
The MoveIt Motion Planning Framework for ROS 2.
unittest_cartesian_limits_aggregator.test.py
Go to the documentation of this file.
1 import launch_testing
2 import os
3 import sys
4 import pytest
5 import unittest
6 
7 from launch import LaunchDescription
8 from launch_ros.actions import Node
9 from launch_testing.util import KeepAliveProc
10 
11 sys.path.append(os.path.dirname(__file__))
12 from common_parameters import load_yaml
13 
14 
15 @pytest.mark.rostest
17  cartesian_limits_yaml = load_yaml(
18  "pilz_industrial_motion_planner",
19  "config/unittest_cartesian_limits_aggregator.yaml",
20  )
21 
22  # run test
23  unittest_cartesian_limits_aggregator = Node(
24  package="pilz_industrial_motion_planner",
25  executable="unittest_cartesian_limits_aggregator",
26  name="unittest_cartesian_limits_aggregator",
27  parameters=[
28  cartesian_limits_yaml,
29  ],
30  output="screen",
31  )
32  return (
33  LaunchDescription(
34  [
35  unittest_cartesian_limits_aggregator,
36  KeepAliveProc(),
37  launch_testing.actions.ReadyToTest(),
38  ]
39  ),
40  {"unittest_cartesian_limits_aggregator": unittest_cartesian_limits_aggregator},
41  )
42 
43 
44 class TestTerminatingProcessStops(unittest.TestCase):
45  def test_gtest_run_complete(self, proc_info, unittest_cartesian_limits_aggregator):
46  proc_info.assertWaitForShutdown(
47  process=unittest_cartesian_limits_aggregator, timeout=4000.0
48  )
49 
50 
51 @launch_testing.post_shutdown_test()
52 class TestOutcome(unittest.TestCase):
53  def test_exit_codes(self, proc_info, unittest_cartesian_limits_aggregator):
54  launch_testing.asserts.assertExitCodes(
55  proc_info, process=unittest_cartesian_limits_aggregator
56  )
def test_exit_codes(self, proc_info, unittest_cartesian_limits_aggregator)
def test_gtest_run_complete(self, proc_info, unittest_cartesian_limits_aggregator)
def load_yaml(package_name, file_path)