File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
nipype/interfaces/base/tests Expand file tree Collapse file tree 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):
517517 ci = OOPBadShell (command = script_name )
518518 with pytest .raises (IOError ):
519519 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