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