def test_when_the_config_key_does_not_exists(self):
from airflow import logging_config
def side_effect(*args):
if args[1] == 'logging_config_class':
raise AirflowConfigException
else:
return "bla_bla_from_test"
logging_config.conf.get = mock.Mock(side_effect=side_effect)
with patch.object(logging_config.log, 'debug') as mock_debug:
logging_config.configure_logging()
mock_debug.assert_any_call('Could not find key logging_config_class in config')
# Just default
test_logging_config.py 文件源码
python
阅读 20
收藏 0
点赞 0
评论 0
评论列表
文章目录