Skip to content

Commit a601e00

Browse files
author
Roger Strain
committed
Fix unit tests
Distro A; OPSEC #4584 Signed-off-by: Roger Strain <[email protected]>
1 parent 7f21a4f commit a601e00

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

launch/launch/descriptions/executable.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ def __init__(
7676
:param: arguments list of extra arguments for the executable
7777
"""
7878
self.__cmd = [normalize_to_list_of_substitutions(x) for x in cmd]
79-
self.__cmd += [] if arguments is None else [normalize_to_list_of_substitutions(x) for x in arguments]
79+
self.__cmd += [] if arguments is None \
80+
else [normalize_to_list_of_substitutions(x) for x in arguments]
8081
self.__prefix = normalize_to_list_of_substitutions(
8182
LaunchConfiguration('launch-prefix', default='') if prefix is None else prefix
8283
)

launch/test/launch/test_executable.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,19 @@ def test_executable():
3434

3535
def test_cmd_string_in_list():
3636
exe = Executable(cmd=['ls "my/subdir/with spaces/"'])
37-
exe.prepare(None, LaunchContext())
37+
exe.prepare(LaunchContext(), None)
3838
assert all(a == b for a, b in zip(exe.final_cmd, ['ls "my/subdir/with spaces/"']))
3939

4040

4141
def test_cmd_strings_in_list():
4242
exe = Executable(cmd=['ls', '"my/subdir/with spaces/"'])
43-
exe.prepare(None, LaunchContext())
43+
exe.prepare(LaunchContext(), None)
4444
assert all(a == b for a, b in zip(exe.final_cmd, ['ls', '"my/subdir/with spaces/"']))
4545

4646

4747
def test_cmd_multiple_arguments_in_string():
4848
exe = Executable(cmd=['ls', '-opt1', '-opt2', '-opt3'])
49-
exe.prepare(None, LaunchContext())
49+
exe.prepare(LaunchContext(), None)
5050
assert all(a == b for a, b in zip(exe.final_cmd, ['ls', '-opt1', '-opt2', '-opt3']))
5151

5252

@@ -55,7 +55,7 @@ def test_passthrough_properties():
5555
cwd = 'cwd'
5656
env = {'a': '1'}
5757
exe = Executable(cmd=['test'], name=name, cwd=cwd, env=env)
58-
exe.prepare(None, LaunchContext())
58+
exe.prepare(LaunchContext(), None)
5959
assert exe.final_name.startswith(name)
6060
assert exe.final_cwd == cwd
6161
assert exe.final_env == env
@@ -70,7 +70,7 @@ def test_substituted_properties():
7070
cwd = EnvironmentVariable('EXECUTABLE_CWD')
7171
env = {EnvironmentVariable('EXECUTABLE_ENVVAR'): EnvironmentVariable('EXECUTABLE_ENVVAL')}
7272
exe = Executable(cmd=['test'], name=name, cwd=cwd, env=env)
73-
exe.prepare(None, LaunchContext())
73+
exe.prepare(LaunchContext(), None)
7474
assert exe.final_name.startswith('name')
7575
assert exe.final_cwd == 'cwd'
7676
assert exe.final_env == {'var': 'value'}

0 commit comments

Comments
 (0)