本文整理汇总了Python中socorro.unittest.testlib.loggerForTest.TestingLogger.info方法的典型用法代码示例。如果您正苦于以下问题:Python TestingLogger.info方法的具体用法?Python TestingLogger.info怎么用?Python TestingLogger.info使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类socorro.unittest.testlib.loggerForTest.TestingLogger
的用法示例。
在下文中一共展示了TestingLogger.info方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testLenFunction
# 需要导入模块: from socorro.unittest.testlib.loggerForTest import TestingLogger [as 别名]
# 或者: from socorro.unittest.testlib.loggerForTest.TestingLogger import info [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: testInfo
# 需要导入模块: from socorro.unittest.testlib.loggerForTest import TestingLogger [as 别名]
# 或者: from socorro.unittest.testlib.loggerForTest.TestingLogger import info [as 别名]
def testInfo():
bl = BogusLogger()
tl = TestingLogger()
tlb = TestingLogger(bl)
tl.info("info")
tlb.info("info")
assert (logging.INFO,'info',()) == bl.item
assert logging.INFO == tl.levels[0]
assert logging.INFO == tlb.levels[0]
assert 'info' == tl.buffer[0]
assert 'info' == tlb.buffer[0]
示例3: testStrFunction
# 需要导入模块: from socorro.unittest.testlib.loggerForTest import TestingLogger [as 别名]
# 或者: from socorro.unittest.testlib.loggerForTest.TestingLogger import info [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 info [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)