-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adapt to '--ros-args ... [--]'-based ROS args extraction #52
Conversation
Signed-off-by: Michel Hidalgo <[email protected]>
Signed-off-by: Michel Hidalgo <[email protected]>
Signed-off-by: Michel Hidalgo <[email protected]>
1945644
to
31a4b53
Compare
@@ -82,7 +82,5 @@ def test_push_ros_namespace(config): | |||
node_namespace=config.node_ns, | |||
) | |||
node._perform_substitutions(lc) | |||
expected_cmd_len = 2 if config.expected_ns is not None else 1 | |||
assert expected_cmd_len == len(node.cmd) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should have been updated to:
expected_cmd_len = 3 if config.expected_ns is not None else 2
assert expected_cmd_len == len(node.cmd)
Checking that __ns:=/
is not added when the expanded namespace is ''
is important.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The thing is that the original test was incorrect, as node.cmd
substitutions are not resolved by node._perform_substitutions()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The len of the list is the same before and after performing the substitutions, so it was ok correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The len of the list is the same before and after performing the substitutions
That is a result of the current implementation, and thus not guaranteed nor enforced by the API.
Checking that __ns:=/ is not added when the expanded namespace is '' is important.
I agree with this, but the former test was not adequate for said purpose. We can change either launch_ros.actions.Node
implementation or the test itself to query the fully resolved cmd
instead of counting substitutions and expecting them to be right.
Precisely what the title says. Connected to ros2/rcl#477.