From 543b8a447288f8ffa7d8f267c3d8a9ccfa3b5f55 Mon Sep 17 00:00:00 2001 From: Michel Hidalgo Date: Wed, 28 Aug 2019 17:34:41 -0300 Subject: [PATCH] Use of -r/--remap flags where appropriate. Signed-off-by: Michel Hidalgo --- test_cli/test/test_params_yaml.py | 43 +++++++++++-------- test_cli_remapping/test/test_cli_remapping.py | 2 +- 2 files changed, 27 insertions(+), 18 deletions(-) diff --git a/test_cli/test/test_params_yaml.py b/test_cli/test/test_params_yaml.py index 20bce17c..2f2f9655 100644 --- a/test_cli/test/test_params_yaml.py +++ b/test_cli/test/test_params_yaml.py @@ -71,8 +71,9 @@ def test_bool_params(node_fixture): command = ( node_fixture['executable'], '--ros-args', - '__params:=' + yaml_file, - '__node:=bool_params' + '--remap', + '__node:=bool_params', + '__params:=' + yaml_file ) with HelperCommand(command): @@ -96,8 +97,9 @@ def test_integer_params(node_fixture): command = ( node_fixture['executable'], '--ros-args', - '__params:=' + yaml_file, - '__node:=int_params' + '--remap', + '__node:=int_params', + '__params:=' + yaml_file ) with HelperCommand(command): @@ -121,8 +123,9 @@ def test_double_params(node_fixture): command = ( node_fixture['executable'], '--ros-args', - '__params:=' + yaml_file, - '__node:=double_params' + '--remap', + '__node:=double_params', + '__params:=' + yaml_file ) with HelperCommand(command): @@ -146,8 +149,9 @@ def test_string_params(node_fixture): command = ( node_fixture['executable'], '--ros-args', - '__params:=' + yaml_file, - '__node:=str_params' + '--remap', + '__node:=str_params', + '__params:=' + yaml_file ) with HelperCommand(command): @@ -174,8 +178,9 @@ def test_bool_array_params(node_fixture): command = ( node_fixture['executable'], '--ros-args', - '__params:=' + yaml_file, - '__node:=ba_params' + '--remap', + '__node:=ba_params', + '__params:=' + yaml_file ) with HelperCommand(command): @@ -199,8 +204,9 @@ def test_integer_array_params(node_fixture): command = ( node_fixture['executable'], '--ros-args', - '__params:=' + yaml_file, - '__node:=ia_params' + '--remap', + '__node:=ia_params', + '__params:=' + yaml_file ) with HelperCommand(command): @@ -224,8 +230,9 @@ def test_double_array_params(node_fixture): command = ( node_fixture['executable'], '--ros-args', - '__params:=' + yaml_file, - '__node:=da_params' + '--remap', + '__node:=da_params', + '__params:=' + yaml_file ) with HelperCommand(command): @@ -249,8 +256,9 @@ def test_string_array_params(node_fixture): command = ( node_fixture['executable'], '--ros-args', - '__params:=' + yaml_file, - '__node:=sa_params' + '--remap', + '__node:=sa_params', + '__params:=' + yaml_file ) with HelperCommand(command): @@ -282,9 +290,10 @@ def test_multiple_parameter_files(node_fixture): command = ( node_fixture['executable'], '--ros-args', + '--remap', + '__node:=multi_params' '__params:=' + first_yaml_file, '__params:=' + second_yaml_file, - '__node:=multi_params' ) with HelperCommand(command): resp = get_params(node_fixture['node'], 'multi_params', ['i1', 'i2', 'i3']) diff --git a/test_cli_remapping/test/test_cli_remapping.py b/test_cli_remapping/test/test_cli_remapping.py index bfe7be99..6de29b78 100644 --- a/test_cli_remapping/test/test_cli_remapping.py +++ b/test_cli_remapping/test/test_cli_remapping.py @@ -81,7 +81,7 @@ def generate_test_description(executable, ready_fn): random.randint(0, 9999), time.strftime('%H_%M_%S', time.gmtime())) launch_description.add_action( ExecuteProcess( - cmd=command + ['--ros-args', cli_argument.format(**locals())], + cmd=command + ['--ros-args', '--remap', cli_argument.format(**locals())], name='name_maker_' + replacement_name, env=env ) )