def test_handle_logging_signal_USR1(self):
self.cls.log_enabled = False
with patch('%s.logger' % pbm) as mock_logger:
with patch('%s.getpid' % pbm) as mock_getpid:
mock_getpid.return_value = 12345
self.cls.handle_logging_signal(signal.SIGUSR1, None)
assert mock_logger.mock_calls == [
call.warning('Logging enabled via signal; send SIGUSR2 to PID %d '
'to disable logging', 12345)
]
assert self.cls.log_enabled is True
test_redirector.py 文件源码
python
阅读 31
收藏 0
点赞 0
评论 0
评论列表
文章目录