本文整理匯總了Python中sek.logger.SEKLogger.endRecording方法的典型用法代碼示例。如果您正苦於以下問題:Python SEKLogger.endRecording方法的具體用法?Python SEKLogger.endRecording怎麽用?Python SEKLogger.endRecording使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類sek.logger.SEKLogger
的用法示例。
在下文中一共展示了SEKLogger.endRecording方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: MSGLoggerTester
# 需要導入模塊: from sek.logger import SEKLogger [as 別名]
# 或者: from sek.logger.SEKLogger import endRecording [as 別名]
class MSGLoggerTester(unittest.TestCase):
def setUp(self):
self.logger = SEKLogger(__name__, level='DEBUG')
print 'logger level: %s' % self.logger.loggerLevel
def testInit(self):
self.logger.log('Testing init.',level='info')
self.assertIsNotNone(self.logger)
def testLogRecording(self):
self.logger.log('Testing log recording.','info')
msg = "Recording test."
self.logger.startRecording()
self.logger.log(msg, 'info')
self.logger.endRecording()
self.logger.log("This should not be logged.", 'info')
result = re.search(msg, self.logger.recording).group(0)
self.logger.log("recording result: %s" % self.logger.recording)
self.assertEqual(result, msg)
def testSilentLogging(self):
return
self.logger.log('Testing silent logging.','info')
msg = "Recording test."
self.logger.startRecording()
self.logger.log(msg, 'silent')
self.logger.endRecording()
self.assertEqual(self.logger.recording, '')
def testDebugLogging(self):
self.logger.log('Testing debug logging','DEBUG')
def testDoublingOfLoggingOutput(self):
self.logger.log('This is a test of doubling of logger output at the beginning of a test.')