diff --git a/force_bdss/tests/test_core_mco_driver.py b/force_bdss/tests/test_core_mco_driver.py index abe17a232fe82f69f29b3f92141a793083867e78..d137b2122c554233e3d8cf29273cf544a8a03500 100644 --- a/force_bdss/tests/test_core_mco_driver.py +++ b/force_bdss/tests/test_core_mco_driver.py @@ -202,3 +202,37 @@ class TestCoreMCODriver(unittest.TestCase): "'force.bdss.enthought.plugin.test.v0'" " raised exception. This might indicate " 'a programming error in the plugin.'),) + + def test_nonexistent_file(self): + self.mock_application.workflow_filepath = fixtures.get( + "test_nonexistent.json") + driver = CoreMCODriver( + application=self.mock_application, + ) + with LogCapture() as capture: + with self.assertRaises(SystemExit): + driver.application_started() + capture.check( + ('force_bdss.core_mco_driver', 'ERROR', + 'Unable to open workflow file.'), + ) + + def test_non_valid_file(self): + self.mock_application.workflow_filepath = fixtures.get( + "test_null.json") + driver = CoreMCODriver( + application=self.mock_application, + ) + with LogCapture() as capture: + with self.assertRaises(SystemExit): + driver.application_started() + capture.check( + ('force_bdss.core_mco_driver', + 'ERROR', + 'Unable to execute workflow due to verification errors :'), + ('force_bdss.core_mco_driver', 'ERROR', + 'MCO has no defined parameters'), + ('force_bdss.core_mco_driver', 'ERROR', + 'Missing input slot name assignment'), + ('force_bdss.core_mco_driver', 'ERROR', + 'Missing output slot name assignment'))