@@ -229,7 +229,7 @@ def test_autocomp_subcmd_flag_comp_list_attr(cmd2_app):
229229 assert first_match is not None and first_match == '"Gareth Edwards'
230230
231231
232- def test_autcomp_pos_consumed (cmd2_app ):
232+ def test_autocomp_pos_consumed (cmd2_app ):
233233 text = ''
234234 line = 'library movie add SW_EP01 {}' .format (text )
235235 endidx = len (line )
@@ -239,7 +239,7 @@ def test_autcomp_pos_consumed(cmd2_app):
239239 assert first_match is None
240240
241241
242- def test_autcomp_pos_after_flag (cmd2_app ):
242+ def test_autocomp_pos_after_flag (cmd2_app ):
243243 text = 'Joh'
244244 line = 'video movies add -d "George Lucas" -- "Han Solo" PG "Emilia Clarke" "{}' .format (text )
245245 endidx = len (line )
@@ -250,7 +250,7 @@ def test_autcomp_pos_after_flag(cmd2_app):
250250 cmd2_app .completion_matches == ['John Boyega" ' ]
251251
252252
253- def test_autcomp_custom_func_list_arg (cmd2_app ):
253+ def test_autocomp_custom_func_list_arg (cmd2_app ):
254254 text = 'SW_'
255255 line = 'library show add {}' .format (text )
256256 endidx = len (line )
@@ -261,7 +261,7 @@ def test_autcomp_custom_func_list_arg(cmd2_app):
261261 cmd2_app .completion_matches == ['SW_CW' , 'SW_REB' , 'SW_TCW' ]
262262
263263
264- def test_autcomp_custom_func_list_and_dict_arg (cmd2_app ):
264+ def test_autocomp_custom_func_list_and_dict_arg (cmd2_app ):
265265 text = ''
266266 line = 'library show add SW_REB {}' .format (text )
267267 endidx = len (line )
@@ -272,6 +272,17 @@ def test_autcomp_custom_func_list_and_dict_arg(cmd2_app):
272272 cmd2_app .completion_matches == ['S01E02' , 'S01E03' , 'S02E01' , 'S02E03' ]
273273
274274
275+ def test_autocomp_custom_func_dict_arg (cmd2_app ):
276+ text = '/home/user/'
277+ line = 'video movies load {}' .format (text )
278+ endidx = len (line )
279+ begidx = endidx - len (text )
280+
281+ first_match = complete_tester (text , line , begidx , endidx , cmd2_app )
282+ assert first_match is not None and \
283+ cmd2_app .completion_matches == ['/home/user/another.db' , '/home/user/file space.db' , '/home/user/file.db' ]
284+
285+
275286def test_argparse_remainder_flag_completion (cmd2_app ):
276287 import cmd2
277288 import argparse
0 commit comments