From c61418e624cd7fb98ea8c521d2feb83113eb8232 Mon Sep 17 00:00:00 2001 From: Pete Baughman Date: Tue, 22 Oct 2019 15:22:26 -0700 Subject: [PATCH] Remove ready_fn from test descriptions Signed-off-by: Pete Baughman --- ros2action/test/test_cli.py | 6 +++--- ros2interface/test/test_cli.py | 6 +++--- ros2msg/test/test_cli.py | 6 +++--- ros2node/test/test_cli.py | 6 +++--- ros2pkg/test/test_cli.py | 6 +++--- ros2service/test/test_cli.py | 6 +++--- ros2srv/test/test_cli.py | 6 +++--- ros2topic/test/test_cli.py | 6 +++--- 8 files changed, 24 insertions(+), 24 deletions(-) diff --git a/ros2action/test/test_cli.py b/ros2action/test/test_cli.py index 90a4cd390..9cdc917e1 100644 --- a/ros2action/test/test_cli.py +++ b/ros2action/test/test_cli.py @@ -20,9 +20,9 @@ from launch import LaunchDescription from launch.actions import ExecuteProcess -from launch.actions import OpaqueFunction import launch_testing +import launch_testing.actions import launch_testing.asserts import launch_testing.markers import launch_testing.tools @@ -37,7 +37,7 @@ @pytest.mark.rostest @launch_testing.parametrize('rmw_implementation', get_available_rmw_implementations()) -def generate_test_description(rmw_implementation, ready_fn): +def generate_test_description(rmw_implementation): path_to_action_server_executable = os.path.join( os.path.dirname(__file__), 'fixtures', 'fibonacci_action_server.py' ) @@ -55,7 +55,7 @@ def generate_test_description(rmw_implementation, ready_fn): cmd=[sys.executable, path_to_action_server_executable], additional_env={'RMW_IMPLEMENTATION': rmw_implementation} ), - OpaqueFunction(function=lambda context: ready_fn()) + launch_testing.actions.ReadyToTest() ], additional_env={'RMW_IMPLEMENTATION': rmw_implementation} ) diff --git a/ros2interface/test/test_cli.py b/ros2interface/test/test_cli.py index 3d962f1dc..8a5904f2d 100644 --- a/ros2interface/test/test_cli.py +++ b/ros2interface/test/test_cli.py @@ -19,9 +19,9 @@ from launch import LaunchDescription from launch.actions import ExecuteProcess -from launch.actions import OpaqueFunction import launch_testing +import launch_testing.actions import launch_testing.asserts import launch_testing.markers import launch_testing.tools @@ -54,8 +54,8 @@ @pytest.mark.rostest @launch_testing.markers.keep_alive -def generate_test_description(ready_fn): - return LaunchDescription([OpaqueFunction(function=lambda context: ready_fn())]) +def generate_test_description(): + return LaunchDescription([launch_testing.actions.ReadyToTest()]) class TestROS2InterfaceCLI(unittest.TestCase): diff --git a/ros2msg/test/test_cli.py b/ros2msg/test/test_cli.py index d06a85e43..a3a1e671a 100644 --- a/ros2msg/test/test_cli.py +++ b/ros2msg/test/test_cli.py @@ -18,9 +18,9 @@ from launch import LaunchDescription from launch.actions import ExecuteProcess -from launch.actions import OpaqueFunction import launch_testing +import launch_testing.actions import launch_testing.asserts import launch_testing.markers import launch_testing.tools @@ -30,8 +30,8 @@ @pytest.mark.rostest @launch_testing.markers.keep_alive -def generate_test_description(ready_fn): - return LaunchDescription([OpaqueFunction(function=lambda context: ready_fn())]) +def generate_test_description(): + return LaunchDescription([launch_testing.actions.ReadyToTest()]) some_messages_from_std_msgs = [ diff --git a/ros2node/test/test_cli.py b/ros2node/test/test_cli.py index 0fdb586d9..391febd13 100644 --- a/ros2node/test/test_cli.py +++ b/ros2node/test/test_cli.py @@ -21,11 +21,11 @@ from launch import LaunchDescription from launch.actions import ExecuteProcess -from launch.actions import OpaqueFunction from launch_ros.actions import Node import launch_testing +import launch_testing.actions import launch_testing.asserts import launch_testing.markers import launch_testing.tools @@ -38,7 +38,7 @@ @pytest.mark.rostest @launch_testing.parametrize('rmw_implementation', get_available_rmw_implementations()) -def generate_test_description(rmw_implementation, ready_fn): +def generate_test_description(rmw_implementation): path_to_complex_node_script = os.path.join( os.path.dirname(__file__), 'fixtures', 'complex_node.py' ) @@ -66,7 +66,7 @@ def generate_test_description(rmw_implementation, ready_fn): node_name='_hidden_complex_node', additional_env=additional_env ), - OpaqueFunction(function=lambda context: ready_fn()) + launch_testing.actions.ReadyToTest() ], additional_env=additional_env ) diff --git a/ros2pkg/test/test_cli.py b/ros2pkg/test/test_cli.py index c224772f8..8d4811ee6 100644 --- a/ros2pkg/test/test_cli.py +++ b/ros2pkg/test/test_cli.py @@ -20,9 +20,9 @@ from launch import LaunchDescription from launch.actions import ExecuteProcess -from launch.actions import OpaqueFunction import launch_testing +import launch_testing.actions import launch_testing.asserts import launch_testing.markers import launch_testing.tools @@ -38,8 +38,8 @@ @pytest.mark.rostest @launch_testing.markers.keep_alive -def generate_test_description(ready_fn): - return LaunchDescription([OpaqueFunction(function=lambda context: ready_fn())]) +def generate_test_description(): + return LaunchDescription([launch_testing.actions.ReadyToTest()]) class TestROS2PkgCLI(unittest.TestCase): diff --git a/ros2service/test/test_cli.py b/ros2service/test/test_cli.py index c0ff38f2c..f52fe291d 100644 --- a/ros2service/test/test_cli.py +++ b/ros2service/test/test_cli.py @@ -22,10 +22,10 @@ from launch import LaunchDescription from launch.actions import ExecuteProcess -from launch.actions import OpaqueFunction from launch_ros.actions import Node import launch_testing +import launch_testing.actions import launch_testing.asserts import launch_testing.markers import launch_testing.tools @@ -56,7 +56,7 @@ def get_echo_call_output(**kwargs): @pytest.mark.rostest @launch_testing.parametrize('rmw_implementation', get_available_rmw_implementations()) -def generate_test_description(rmw_implementation, ready_fn): +def generate_test_description(rmw_implementation): path_to_echo_server_script = os.path.join( os.path.dirname(__file__), 'fixtures', 'echo_server.py' ) @@ -87,7 +87,7 @@ def generate_test_description(rmw_implementation, ready_fn): remappings=[('echo', '_echo')], additional_env=additional_env, ), - OpaqueFunction(function=lambda context: ready_fn()) + launch_testing.actions.ReadyToTest() ], additional_env=additional_env ) diff --git a/ros2srv/test/test_cli.py b/ros2srv/test/test_cli.py index b6322eafa..bc883db25 100644 --- a/ros2srv/test/test_cli.py +++ b/ros2srv/test/test_cli.py @@ -18,9 +18,9 @@ from launch import LaunchDescription from launch.actions import ExecuteProcess -from launch.actions import OpaqueFunction import launch_testing +import launch_testing.actions import launch_testing.asserts import launch_testing.markers import launch_testing.tools @@ -30,8 +30,8 @@ @pytest.mark.rostest @launch_testing.markers.keep_alive -def generate_test_description(ready_fn): - return LaunchDescription([OpaqueFunction(function=lambda context: ready_fn())]) +def generate_test_description(): + return LaunchDescription([launch_testing.actions.ReadyToTest()]) some_services_from_std_srvs = [ diff --git a/ros2topic/test/test_cli.py b/ros2topic/test/test_cli.py index 7d704fdc5..9bc6ed5a2 100644 --- a/ros2topic/test/test_cli.py +++ b/ros2topic/test/test_cli.py @@ -22,11 +22,11 @@ from launch import LaunchDescription from launch.actions import ExecuteProcess -from launch.actions import OpaqueFunction from launch_ros.actions import Node import launch_testing +import launch_testing.actions import launch_testing.asserts import launch_testing.markers import launch_testing.tools @@ -39,7 +39,7 @@ @pytest.mark.rostest @launch_testing.parametrize('rmw_implementation', get_available_rmw_implementations()) -def generate_test_description(rmw_implementation, ready_fn): +def generate_test_description(rmw_implementation): path_to_fixtures = os.path.join(os.path.dirname(__file__), 'fixtures') additional_env = { 'RMW_IMPLEMENTATION': rmw_implementation, 'PYTHONUNBUFFERED': '1' @@ -132,7 +132,7 @@ def generate_test_description(rmw_implementation, ready_fn): unbounded_sequences_repeater_node_action, # Add stamped data publisher. cmd_vel_controller_node_action, - OpaqueFunction(function=lambda context: ready_fn()) + launch_testing.actions.ReadyToTest() ], additional_env=additional_env )