def test_logging_settings_list(self, mock_dictConfig): conf_logging_not_dict = { self.LOGGING_KEY: [1, 2, 3], } conf = config_factory.create(**conf_logging_not_dict) config.prepare_config(conf) mock_dictConfig.assert_not_called()
def test_logging_settings_dict(self, mock_dictConfig): conf_logging_dict = { self.LOGGING_KEY: { 'mock': True, } } conf = config_factory.create(**conf_logging_dict) config.prepare_config(conf) mock_dictConfig.assert_called_with(conf_logging_dict.get(self.LOGGING_KEY))
def test_verbose_log(self): conf = { self.VERBOSE_KEY: False, self.STEPS_LOG_KEY: False, self.FLOWS_LOG_KEY: False, } conf_obj = config_factory.create(**conf) config.prepare_config(conf_obj) self.assertFalse(conf_obj.get(self.VERBOSE_KEY)) conf[self.STEPS_LOG_KEY] = True conf[self.FLOWS_LOG_KEY] = False conf_obj = config_factory.create(**conf) config.prepare_config(conf_obj) self.assertTrue(conf_obj.get(self.VERBOSE_KEY)) conf[self.STEPS_LOG_KEY] = False conf[self.FLOWS_LOG_KEY] = True conf_obj = config_factory.create(**conf) config.prepare_config(conf_obj) self.assertTrue(conf_obj.get(self.VERBOSE_KEY)) conf[self.STEPS_LOG_KEY] = True conf[self.FLOWS_LOG_KEY] = True conf_obj = config_factory.create(**conf) config.prepare_config(conf_obj) self.assertTrue(conf_obj.get(self.VERBOSE_KEY))
def test_multiprocessing_async(self): conf = { self.MULTIPROCESSING_KEY: False, self.GEVENT_KEY: False, self.THREADING_KEY: False, self.ASYNC_SUITES_KEY: False, self.ASYNC_TESTS_KEY: False, } conf_obj = config_factory.create(**conf) config.prepare_config(conf_obj) self.assertFalse(conf_obj.get(self.MULTIPROCESSING_KEY)) conf[self.ASYNC_SUITES_KEY] = True conf[self.ASYNC_TESTS_KEY] = False conf_obj = config_factory.create(**conf) config.prepare_config(conf_obj) self.assertTrue(conf_obj.get(self.MULTIPROCESSING_KEY)) conf[self.ASYNC_SUITES_KEY] = False conf[self.ASYNC_TESTS_KEY] = True conf_obj = config_factory.create(**conf) config.prepare_config(conf_obj) self.assertTrue(conf_obj.get(self.MULTIPROCESSING_KEY)) conf[self.ASYNC_SUITES_KEY] = True conf[self.ASYNC_TESTS_KEY] = True conf_obj = config_factory.create(**conf) config.prepare_config(conf_obj) self.assertTrue(conf_obj.get(self.MULTIPROCESSING_KEY))