本文整理汇总了Python中socorro.unittest.testlib.loggerForTest.TestingLogger.warn方法的典型用法代码示例。如果您正苦于以下问题:Python TestingLogger.warn方法的具体用法?Python TestingLogger.warn怎么用?Python TestingLogger.warn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类socorro.unittest.testlib.loggerForTest.TestingLogger
的用法示例。
在下文中一共展示了TestingLogger.warn方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testLenFunction
# 需要导入模块: from socorro.unittest.testlib.loggerForTest import TestingLogger [as 别名]
# 或者: from socorro.unittest.testlib.loggerForTest.TestingLogger import warn [as 别名]
def testLenFunction():
tl = TestingLogger()
exp = 0
assert exp == len(tl)
tl.debug('woo')
exp += 1
assert exp == len(tl)
tl.info('woo')
exp += 1
assert exp == len(tl)
tl.warning('woo')
exp += 1
assert exp == len(tl)
tl.warn('woo')
exp += 1
assert exp == len(tl)
tl.error('woo')
exp += 1
assert exp == len(tl)
tl.critical('woo')
exp += 1
assert exp == len(tl)
tl.fatal('woo')
exp += 1
assert exp == len(tl)
示例2: testWarn
# 需要导入模块: from socorro.unittest.testlib.loggerForTest import TestingLogger [as 别名]
# 或者: from socorro.unittest.testlib.loggerForTest.TestingLogger import warn [as 别名]
def testWarn():
bl = BogusLogger()
tl = TestingLogger()
tlb = TestingLogger(bl)
tl.warn("warn")
tlb.warn("warn")
assert (logging.WARN,'warn',()) == bl.item
assert logging.WARN == tl.levels[0]
assert logging.WARN == tlb.levels[0]
assert 'warn' == tl.buffer[0]
assert 'warn' == tlb.buffer[0]
示例3: testStrFunction
# 需要导入模块: from socorro.unittest.testlib.loggerForTest import TestingLogger [as 别名]
# 或者: from socorro.unittest.testlib.loggerForTest.TestingLogger import warn [as 别名]
def testStrFunction():
tl = TestingLogger()
assert '' == str(tl)
tl.debug('debug')
expLines = ['DEBUG (10): debug']
tl.info('info')
expLines.append('INFO (20): info')
tl.warn('warn')
expLines.append('WARNING (30): warn')
tl.warning('warning')
expLines.append('WARNING (30): warning')
tl.error('error')
expLines.append('ERROR (40): error')
tl.critical('critical')
expLines.append('FATAL (50): critical')
tl.fatal('fatal')
expLines.append('FATAL (50): fatal')
expected = "\n".join(expLines)
assert expected == str(tl)
示例4: testClear
# 需要导入模块: from socorro.unittest.testlib.loggerForTest import TestingLogger [as 别名]
# 或者: from socorro.unittest.testlib.loggerForTest.TestingLogger import warn [as 别名]
def testClear():
tl = TestingLogger()
tl.clear()
assert 0 == len(tl)
assert 0 == len(tl.levels)
assert 0 == len(tl.buffer)
tl.debug('woo')
tl.info('woo')
tl.warning('woo')
tl.warn('woo')
tl.error('woo')
tl.critical('woo')
tl.fatal('woo')
assert 7 == len(tl)
assert 7 == len(tl.levels)
assert 7 == len(tl.buffer)
tl.clear()
assert 0 == len(tl)
assert 0 == len(tl.levels)
assert 0 == len(tl.buffer)