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