moveit2
The MoveIt Motion Planning Framework for ROS 2.
Loading...
Searching...
No Matches
unittest_trajectory_generator_circ.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_generator_circ.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_generator_circ = Node(
35 package="pilz_industrial_motion_planner",
36 executable="unittest_trajectory_generator_circ",
37 name="unittest_trajectory_generator_circ",
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_generator_circ,
49 KeepAliveProc(),
50 launch_testing.actions.ReadyToTest(),
51 ]
52 ),
53 {"unittest_trajectory_generator_circ": unittest_trajectory_generator_circ},
54 )
55
56
57class TestTerminatingProcessStops(unittest.TestCase):
58 def test_gtest_run_complete(self, proc_info, unittest_trajectory_generator_circ):
59 proc_info.assertWaitForShutdown(
60 process=unittest_trajectory_generator_circ, timeout=4000.0
61 )
62
63
64@launch_testing.post_shutdown_test()
65class TestOutcome(unittest.TestCase):
66 def test_exit_codes(self, proc_info, unittest_trajectory_generator_circ):
67 launch_testing.asserts.assertExitCodes(
68 proc_info, process=unittest_trajectory_generator_circ
69 )
test_exit_codes(self, proc_info, unittest_trajectory_generator_circ)