moveit2
The MoveIt Motion Planning Framework for ROS 2.
unittest_planning_context_loaders.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  # run test
23  unittest_planning_context_loaders = Node(
24  package="pilz_industrial_motion_planner",
25  executable="unittest_planning_context_loaders",
26  name="unittest_planning_context_loaders",
27  parameters=[
28  test_config.to_dict(),
29  ],
30  output="screen",
31  )
32  return (
33  LaunchDescription(
34  [
35  unittest_planning_context_loaders,
36  KeepAliveProc(),
37  launch_testing.actions.ReadyToTest(),
38  ]
39  ),
40  {"unittest_planning_context_loaders": unittest_planning_context_loaders},
41  )
42 
43 
44 class TestTerminatingProcessStops(unittest.TestCase):
45  def test_gtest_run_complete(self, proc_info, unittest_planning_context_loaders):
46  proc_info.assertWaitForShutdown(
47  process=unittest_planning_context_loaders, 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_planning_context_loaders):
54  launch_testing.asserts.assertExitCodes(
55  proc_info, process=unittest_planning_context_loaders
56  )
def test_exit_codes(self, proc_info, unittest_planning_context_loaders)
def test_gtest_run_complete(self, proc_info, unittest_planning_context_loaders)