def test_handle_logging_signal_USR2(self):
self.cls.log_enabled = True
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.SIGUSR2, None)
assert mock_logger.mock_calls == [
call.warning('Logging disabled via signal; send SIGUSR1 to PID %d '
'to enable logging', 12345)
]
assert self.cls.log_enabled is False
test_redirector.py 文件源码
python
阅读 29
收藏 0
点赞 0
评论 0
评论列表
文章目录