File tree 1 file changed +26
-0
lines changed
nipype/interfaces/base/tests
1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -517,3 +517,29 @@ class OOPBadShell(nib.CommandLine):
517
517
ci = OOPBadShell (command = script_name )
518
518
with pytest .raises (IOError ):
519
519
ci .run ()
520
+
521
+
522
+ def test_runtime_checks ():
523
+ class TestInterface (nib .BaseInterface ):
524
+ class input_spec (nib .TraitedSpec ):
525
+ a = nib .traits .Any ()
526
+ class output_spec (nib .TraitedSpec ):
527
+ b = nib .traits .Any ()
528
+
529
+ def _run_interface (self , runtime ):
530
+ return runtime
531
+
532
+ class NoRuntime (TestInterface ):
533
+ def _run_interface (self , runtime ):
534
+ return None
535
+
536
+ class BrokenRuntime (TestInterface ):
537
+ def _run_interface (self , runtime ):
538
+ del runtime .__dict__ ['cwd' ]
539
+ return runtime
540
+
541
+ with pytest .raises (RuntimeError ):
542
+ NoRuntime ().run ()
543
+
544
+ with pytest .raises (RuntimeError ):
545
+ BrokenRuntime ().run ()
You can’t perform that action at this time.
0 commit comments