예제 #1
0
 def test_formatter_data(self):
     fmt = SysLogFormatter()
     self.record.levelno = logging.DEBUG
     self.record.args['data'] = (('foo', 'bar'),)
     msg = fmt.format(self.record)
     assert 'cs1=bar' in msg
     assert 'cs1Label=foo' in msg
예제 #2
0
 def test_formatter_data_two(self):
     fmt = SysLogFormatter()
     self.record.levelno = logging.DEBUG
     self.record.args['data'] = (('foo', 'bar'), ('baz', 'bingo'))
     msg = fmt.format(self.record)
     assert 'cs1=bar' in msg
     assert 'cs2=bingo' in msg
예제 #3
0
파일: test_cef.py 프로젝트: hofst/cef
 def test_formatter_level(self):
     fmt = SysLogFormatter()
     self.record.levelno = logging.DEBUG
     data = fmt.format(self.record)
     assert data.split('|')[6] == str(syslog.LOG_DEBUG)
예제 #4
0
 def test_multiple_interpolation(self):
     fmt = SysLogFormatter()
     self.record.levelno = logging.DEBUG
     self.record.args['data'] = (('foo', '%f'),)
     assert 'cs1Label=foo' in fmt.format(self.record)
예제 #5
0
 def _test_formatter_level(self):
     fmt = SysLogFormatter()
     self.record.levelno = logging.DEBUG
     data = fmt.format(self.record)
     assert data.split('|')[6] == str(syslog.LOG_DEBUG)