@@ -32,6 +32,29 @@ class TestResolveProcess(unittest.TestCase):
3232 def test_unlaunched_process_lookup (self ):
3333 info_obj = launch_testing .ProcInfoHandler ()
3434
35+ lookup_obj = launch .actions .ExecuteLocal (
36+ process_description = launch .descriptions .Executable (
37+ cmd = [
38+ 'python' ,
39+ '-c' ,
40+ '' ,
41+ ]
42+ )
43+ )
44+
45+ with self .assertRaises (launch_testing .util .NoMatchingProcessException ) as cm :
46+ launch_testing .util .resolveProcesses (
47+ info_obj ,
48+ process = lookup_obj
49+ )
50+
51+ # We'll get a good error mesasge here because there were no substitutions in
52+ # the execute process cmd - it's all text
53+ self .assertIn ('python -c' , str (cm .exception ))
54+
55+ def test_backward_compatible_unlaunched_process_lookup (self ):
56+ info_obj = launch_testing .ProcInfoHandler ()
57+
3558 lookup_obj = launch .actions .ExecuteProcess (
3659 cmd = [
3760 'python' ,
@@ -53,6 +76,30 @@ def test_unlaunched_process_lookup(self):
5376 def test_unlaunched_process_lookup_with_substitutions (self ):
5477 info_obj = launch_testing .ProcInfoHandler ()
5578
79+ lookup_obj = launch .actions .ExecuteLocal (
80+ process_description = launch .descriptions .Executable (
81+ cmd = [
82+ launch .substitutions .LocalSubstitution ('foo' ),
83+ 'python' ,
84+ '-c' ,
85+ '' ,
86+ ]
87+ )
88+ )
89+
90+ with self .assertRaises (launch_testing .util .NoMatchingProcessException ) as cm :
91+ launch_testing .util .resolveProcesses (
92+ info_obj ,
93+ process = lookup_obj
94+ )
95+
96+ # Since the process wasn't launched yet, and it has substitutions that need to be
97+ # resolved by the launch system, we won't be able to take a guess at the command
98+ self .assertIn ('Unknown' , str (cm .exception ))
99+
100+ def test_backward_compatible_unlaunched_process_lookup_with_substitutions (self ):
101+ info_obj = launch_testing .ProcInfoHandler ()
102+
56103 lookup_obj = launch .actions .ExecuteProcess (
57104 cmd = [
58105 launch .substitutions .LocalSubstitution ('foo' ),
0 commit comments