@@ -219,14 +219,6 @@ def cmd2_app():
219219 return CompletionsExample ()
220220
221221
222- def test_cmd2_command_completion_single (cmd2_app ) -> None :
223- text = 'he'
224- line = text
225- endidx = len (line )
226- begidx = endidx - len (text )
227- assert cmd2_app .basic_complete (text , line , begidx , endidx , cmd2_app .get_all_commands ()) == ['help' ]
228-
229-
230222def test_complete_command_single (cmd2_app ) -> None :
231223 text = 'he'
232224 line = text
@@ -322,15 +314,21 @@ def test_cmd2_command_completion_multiple(cmd2_app) -> None:
322314 line = text
323315 endidx = len (line )
324316 begidx = endidx - len (text )
325- assert cmd2_app .basic_complete (text , line , begidx , endidx , cmd2_app .get_all_commands ()) == ['help' , 'history' ]
317+
318+ first_match = complete_tester (text , line , begidx , endidx , cmd2_app )
319+ assert first_match is not None
320+ assert cmd2_app .completion_matches == ['help' , 'history' ]
326321
327322
328323def test_cmd2_command_completion_nomatch (cmd2_app ) -> None :
329324 text = 'fakecommand'
330325 line = text
331326 endidx = len (line )
332327 begidx = endidx - len (text )
333- assert cmd2_app .basic_complete (text , line , begidx , endidx , cmd2_app .get_all_commands ()) == []
328+
329+ first_match = complete_tester (text , line , begidx , endidx , cmd2_app )
330+ assert first_match is None
331+ assert cmd2_app .completion_matches == []
334332
335333
336334def test_cmd2_help_completion_single (cmd2_app ) -> None :
0 commit comments