From 76e3aebad15348d7b77d51b19fdfc646e740b474 Mon Sep 17 00:00:00 2001 From: Stefano Borini <sborini@enthought.com> Date: Mon, 21 May 2018 17:32:46 +0100 Subject: [PATCH] Added some tests --- .../tests/test_core_evaluation_driver.py | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/force_bdss/tests/test_core_evaluation_driver.py b/force_bdss/tests/test_core_evaluation_driver.py index 8c7d8f7..027a62a 100644 --- a/force_bdss/tests/test_core_evaluation_driver.py +++ b/force_bdss/tests/test_core_evaluation_driver.py @@ -308,3 +308,28 @@ class TestCoreEvaluationDriver(unittest.TestCase): ".factory.probe_mco' in plugin " "'force.bdss.enthought.plugin.test.v0'. " "This may indicate a programming error in the plugin")) + + def test_data_source_broken(self): + factory = self.registry.data_source_factories[0] + factory.raises_on_create_data_source = True + driver = CoreEvaluationDriver( + application=self.mock_application, + ) + + with testfixtures.LogCapture() as capture: + with self.assertRaises(Exception): + driver.application_started() + capture.check( + ('force_bdss.core_evaluation_driver', 'INFO', + 'Creating communicator'), + ('force_bdss.core_evaluation_driver', 'INFO', + 'Received data from MCO: \n'), + ('force_bdss.core_evaluation_driver', 'INFO', + 'Computing data layer 0'), + ('force_bdss.core_evaluation_driver', 'ERROR', + 'Unable to create data source from factory ' + "'force.bdss.enthought.plugin.test.v0" + ".factory.probe_data_source' in plugin " + "'force.bdss.enthought.plugin.test.v0'. " + "This may indicate a programming error in the plugin")) + -- GitLab