Exemple #1
0
 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)
Exemple #2
0
 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 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)
Exemple #5
0
 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)
Exemple #6
0
 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)
Exemple #7
0
    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 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'
Exemple #9
0
 def setUp(self):
     self.tester = LogTester()
     # add stderrHandler to fully test unicode handling
     log.addLogHandler(log.stderrHandler)
Exemple #10
0
    def testOwnLogHandlerLimited(self):
        log.setDebug("testlog:3")
        log.addLogHandler(self.handler)

        self.tester.log("visible")
        assert self.message == 'override visible'
    def testOwnLogHandlerLimited(self):
        log.setDebug("testlog:3")
        log.addLogHandler(self.handler)

        self.tester.log("visible")
        assert self.message == 'override visible'
Exemple #12
0
 def setUp(self):
     self.tester = LogTester()
     # add stderrHandler to fully test unicode handling
     log.addLogHandler(log.stderrHandler)