def test_exception(self): local = Local() local.engine = EngineEmul() local.engine.config[ScenarioExecutor.EXEC] = [{}] local.engine.config.get("settings")["default-executor"] = "mock" local.prepare() local.startup() local.check() local.shutdown() try: local.post_process() except ToolError as exc: self.assertNotIn('DIAGNOSTICS', str(exc)) self.assertIsNotNone(exc.diagnostics) self.assertEqual(exc.diagnostics, ['DIAGNOSTICS']) except BaseException as exc: self.fail("Was supposed to fail with ToolError, but crashed with %s" % exc)
def test_exception(self): local = Local() local.engine = EngineEmul() local.engine.config.merge({ScenarioExecutor.EXEC: [{}]}) local.engine.config.get("settings")["default-executor"] = "mock" local.engine.unify_config() local.prepare() local.startup() local.check() local.shutdown() try: local.post_process() except ToolError as exc: self.assertNotIn('DIAGNOSTICS', str(exc)) self.assertIsNotNone(exc.diagnostics) self.assertEqual(exc.diagnostics, ['DIAGNOSTICS']) except BaseException as exc: self.fail("Was supposed to fail with ToolError, but crashed with %s" % exc)
def test_start_sequential_global(self): local = Local() local.settings["sequential"] = True local.engine = EngineEmul() local.engine.config[ScenarioExecutor.EXEC] = [{}, {}] local.engine.config.get("settings")["default-executor"] = "mock" local.prepare() local.startup() cnt = 0 while not local.check(): cnt += 1 self.assertEqual(3, cnt) local.shutdown() for executor in local.executors: executor.is_has_results = True local.post_process()
def test_check_sequential_slots(self): local = Local() local.settings["capacity"] = 2 local.engine = EngineEmul() local.engine.config.merge({EXEC: [{}, {}, {}, {}, {}]}) local.engine.config.get("settings")["default-executor"] = "mock" local.engine.unify_config() local.prepare() local.startup() cnt = 0 while not local.check(): cnt += 1 self.assertEqual(5, cnt) local.shutdown() for executor in local.executors: executor.is_has_results = True local.post_process()