@@ -374,15 +374,52 @@ def test_input_file_hash_5(tmpdir):
374
374
375
375
376
376
377
- def test_task_inputs_mandatory_with_xOR ():
377
+ def test_task_inputs_mandatory_with_xOR_TF ():
378
378
"""input spec with mandatory inputs"""
379
379
input_fields = [
380
380
(
381
381
"input_1" ,
382
382
bool ,
383
383
{
384
384
"help_string" : "help" ,
385
- "argstr" : "--i1" ,
385
+ "mandatory" : True ,
386
+ "xor" : ("input_1" , "input_2" ),
387
+ }
388
+ ),
389
+ (
390
+ "input_2" ,
391
+ bool ,
392
+ {
393
+ "help_string" : "help" ,
394
+ "mandatory" : True ,
395
+ "argstr" : "--i2" ,
396
+ "xor" : ("input_1" , "input_2" ),
397
+ }
398
+ )
399
+ ]
400
+ task_input_spec = SpecInfo (name = "Input" , fields = input_fields , bases = (ShellSpec ,))
401
+ task_output_fields = []
402
+ task_output_spec = SpecInfo (name = "Output" , fields = task_output_fields , bases = (ShellOutSpec ,))
403
+
404
+ class MyTask (ShellCommandTask ):
405
+ input_spec = task_input_spec
406
+ output_spec = task_output_spec
407
+ executable = "cmd"
408
+
409
+ task = MyTask ()
410
+ task .inputs .input_1 = True
411
+ task .inputs .input_2 = attr .NOTHING
412
+ task .inputs .check_fields_input_spec ()
413
+
414
+ def test_task_inputs_mandatory_with_xOR_TT ():
415
+ """input spec with mandatory inputs"""
416
+ input_fields = [
417
+ (
418
+ "input_1" ,
419
+ bool ,
420
+ {
421
+ "help_string" : "help" ,
422
+ "mandatory" : True ,
386
423
"xor" : ("input_1" , "input_2" ),
387
424
}
388
425
),
@@ -404,10 +441,9 @@ def test_task_inputs_mandatory_with_xOR():
404
441
class MyTask (ShellCommandTask ):
405
442
input_spec = task_input_spec
406
443
output_spec = task_output_spec
407
- executable = "task "
444
+ executable = "cmd "
408
445
409
446
task = MyTask ()
410
447
task .inputs .input_1 = True
411
448
task .inputs .input_2 = True
412
449
task .inputs .check_fields_input_spec ()
413
- #task.cmdline
0 commit comments