def testWriteMarkInLog(self): loggable = log.Loggable() log.setDebug("5") log.addLogHandler(self.handler) marker = 'test' loggable.writeMarker(marker, log.LOG) self.assertEquals(self.message, marker)
def testWriteMarkInError(self): loggable = log.Loggable() log.setDebug("4") log.addLogHandler(self.handler) marker = 'test' self.assertRaises(SystemExit, loggable.writeMarker, marker, log.ERROR) self.assertEquals(self.message, marker)
def testWriteMarkInInfo(self): loggable = log.Loggable() log.setDebug("3") log.addLogHandler(self.handler) marker = "test" loggable.writeMarker(marker, log.INFO) self.assertEquals(self.message, marker)
def testWriteMarkInWarn(self): loggable = log.Loggable() log.setDebug("2") log.addLogHandler(self.handler) marker = "test" loggable.writeMarker(marker, log.WARN) self.assertEquals(self.message, marker)
def testLogHandler(self): log.setDebug("testlog:3") log.addLogHandler(self.handler) self.tester.log("visible") assert self.message == 'visible' self.tester.warning("also visible") assert self.message == 'also visible'
def setUp(self): self.tester = LogTester() # add stderrHandler to fully test unicode handling log.addLogHandler(log.stderrHandler)
def testOwnLogHandlerLimited(self): log.setDebug("testlog:3") log.addLogHandler(self.handler) self.tester.log("visible") assert self.message == 'override visible'