moveit2
The MoveIt Motion Planning Framework for ROS 2.
Loading...
Searching...
No Matches
unittest_trajectory_blender_transition_window.test.py
Go to the documentation of this file.
1import launch_testing
2import pytest
3import unittest
4from ament_index_python.packages import get_package_share_directory
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, load_yaml
14
15
16@pytest.mark.rostest
18 # Load the context
19 test_config = load_moveit_config()
20
21 test_param = load_yaml(
22 "pilz_industrial_motion_planner",
23 "config/unittest_trajectory_blender_transition_window.yaml",
24 )
25
26 testdata_file_name = {
27 "testdata_file_name": get_package_share_directory(
28 "pilz_industrial_motion_planner"
29 )
30 + "/test_data/prbt/testdata_sequence.xml"
31 }
32
33 # run test
34 unittest_trajectory_blender_transition_window = Node(
35 package="pilz_industrial_motion_planner",
36 executable="unittest_trajectory_blender_transition_window",
37 name="unittest_trajectory_blender_transition_window",
38 parameters=[
39 test_config.to_dict(),
40 test_param,
41 testdata_file_name,
42 ],
43 output="screen",
44 )
45 return (
46 LaunchDescription(
47 [
48 unittest_trajectory_blender_transition_window,
49 KeepAliveProc(),
50 launch_testing.actions.ReadyToTest(),
51 ]
52 ),
53 {
54 "unittest_trajectory_blender_transition_window": unittest_trajectory_blender_transition_window
55 },
56 )
57
58
59class TestTerminatingProcessStops(unittest.TestCase):
61 self, proc_info, unittest_trajectory_blender_transition_window
62 ):
63 proc_info.assertWaitForShutdown(
64 process=unittest_trajectory_blender_transition_window, timeout=4000.0
65 )
66
67
68@launch_testing.post_shutdown_test()
69class TestOutcome(unittest.TestCase):
70 def test_exit_codes(self, proc_info, unittest_trajectory_blender_transition_window):
71 launch_testing.asserts.assertExitCodes(
72 proc_info, process=unittest_trajectory_blender_transition_window
73 )
test_exit_codes(self, proc_info, unittest_trajectory_blender_transition_window)