@@ -441,7 +441,35 @@ def test_shell_cmd_inputs_list_sep_2():
441
441
assert shelly .cmdline == "executable -v aaa,bbb,ccc"
442
442
443
443
444
- def test_shell_cmd_inputs_sep_3 ():
444
+ def test_shell_cmd_inputs_list_sep_2a ():
445
+ """providing list as an additional input:, sep, and argstr with f-string"""
446
+ my_input_spec = SpecInfo (
447
+ name = "Input" ,
448
+ fields = [
449
+ (
450
+ "inpA" ,
451
+ attr .ib (
452
+ type = str ,
453
+ metadata = {
454
+ "position" : 1 ,
455
+ "help_string" : "inpA" ,
456
+ "sep" : "," ,
457
+ "argstr" : "-v {inpA}" ,
458
+ },
459
+ ),
460
+ )
461
+ ],
462
+ bases = (ShellSpec ,),
463
+ )
464
+
465
+ shelly = ShellCommandTask (
466
+ executable = "executable" , inpA = ["aaa" , "bbb" , "ccc" ], input_spec = my_input_spec
467
+ )
468
+ # a flag is used once
469
+ assert shelly .cmdline == "executable -v aaa,bbb,ccc"
470
+
471
+
472
+ def test_shell_cmd_inputs_list_sep_3 ():
445
473
"""providing list as an additional input:, sep, argstr with ..."""
446
474
my_input_spec = SpecInfo (
447
475
name = "Input" ,
@@ -469,6 +497,34 @@ def test_shell_cmd_inputs_sep_3():
469
497
assert shelly .cmdline == "executable -v aaa, -v bbb, -v ccc"
470
498
471
499
500
+ def test_shell_cmd_inputs_list_sep_3a ():
501
+ """providing list as an additional input:, sep, argstr with ... and f-string"""
502
+ my_input_spec = SpecInfo (
503
+ name = "Input" ,
504
+ fields = [
505
+ (
506
+ "inpA" ,
507
+ attr .ib (
508
+ type = str ,
509
+ metadata = {
510
+ "position" : 1 ,
511
+ "help_string" : "inpA" ,
512
+ "sep" : "," ,
513
+ "argstr" : "-v {inpA}..." ,
514
+ },
515
+ ),
516
+ )
517
+ ],
518
+ bases = (ShellSpec ,),
519
+ )
520
+
521
+ shelly = ShellCommandTask (
522
+ executable = "executable" , inpA = ["aaa" , "bbb" , "ccc" ], input_spec = my_input_spec
523
+ )
524
+ # a flag is repeated
525
+ assert shelly .cmdline == "executable -v aaa, -v bbb, -v ccc"
526
+
527
+
472
528
def test_shell_cmd_inputs_sep_4 ():
473
529
"""providing 1-el list as an additional input:, sep, argstr with ...,"""
474
530
my_input_spec = SpecInfo (
0 commit comments