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
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
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)
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)
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)