当前位置: 首页>>代码示例>>Python>>正文


Python TestingLogger.critical方法代码示例

本文整理汇总了Python中socorro.unittest.testlib.loggerForTest.TestingLogger.critical方法的典型用法代码示例。如果您正苦于以下问题:Python TestingLogger.critical方法的具体用法?Python TestingLogger.critical怎么用?Python TestingLogger.critical使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在socorro.unittest.testlib.loggerForTest.TestingLogger的用法示例。


在下文中一共展示了TestingLogger.critical方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: testLenFunction

# 需要导入模块: from socorro.unittest.testlib.loggerForTest import TestingLogger [as 别名]
# 或者: from socorro.unittest.testlib.loggerForTest.TestingLogger import critical [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)
开发者ID:Manchester412,项目名称:socorro,代码行数:27,代码来源:testLoggerForTest.py

示例2: testCritical

# 需要导入模块: from socorro.unittest.testlib.loggerForTest import TestingLogger [as 别名]
# 或者: from socorro.unittest.testlib.loggerForTest.TestingLogger import critical [as 别名]
def testCritical():
  bl = BogusLogger()
  tl = TestingLogger()
  tlb = TestingLogger(bl)
  tl.critical("critical")
  tlb.critical("critical")
  assert (logging.CRITICAL,'critical',()) == bl.item
  assert logging.CRITICAL == tl.levels[0]
  assert logging.CRITICAL == tlb.levels[0]
  assert 'critical' == tl.buffer[0]
  assert 'critical' == tlb.buffer[0]
开发者ID:Manchester412,项目名称:socorro,代码行数:13,代码来源:testLoggerForTest.py

示例3: testStrFunction

# 需要导入模块: from socorro.unittest.testlib.loggerForTest import TestingLogger [as 别名]
# 或者: from socorro.unittest.testlib.loggerForTest.TestingLogger import critical [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)
开发者ID:Manchester412,项目名称:socorro,代码行数:21,代码来源:testLoggerForTest.py

示例4: testClear

# 需要导入模块: from socorro.unittest.testlib.loggerForTest import TestingLogger [as 别名]
# 或者: from socorro.unittest.testlib.loggerForTest.TestingLogger import critical [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)
开发者ID:Manchester412,项目名称:socorro,代码行数:25,代码来源:testLoggerForTest.py


注:本文中的socorro.unittest.testlib.loggerForTest.TestingLogger.critical方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。