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