Exemplo n.º 1
0
    def test_log_healthnmon_formatter_without_logrecord(self):
        formatter = HealthnmonFormatter()

        try:
            raise Exception('This is exceptional')
        except Exception as ex:
            exc_info = sys.exc_info()
            formatter.formatException(exc_info)
            self.assert_(True)
Exemplo n.º 2
0
    def test_log_healthnmon_formatter_without_logrecord(self):
        formatter = HealthnmonFormatter()

        try:
            raise Exception('This is exceptional')
        except Exception as ex:
            exc_info = sys.exc_info()
            formatter.formatException(exc_info)
            self.assert_(True)
Exemplo n.º 3
0
    def test_log_healthnmon_formatter_formatexception(self):
        formatter = HealthnmonFormatter()

        try:
            raise Exception('This is exceptional')
        except Exception as ex:
            exc_info = sys.exc_info()
            logrecord = logging.LogRecord('healthnmon', 10, '/root/git/healthnmon/healthnmon/log.py', 117, 'foo', None, exc_info)
            result = formatter.formatException(exc_info, logrecord)
            self.assert_(True)
Exemplo n.º 4
0
    def test_log_healthnmon_formatter_formatexception(self):
        formatter = HealthnmonFormatter()

        try:
            raise Exception('This is exceptional')
        except Exception as ex:
            exc_info = sys.exc_info()
            logrecord = logging.LogRecord(
                'healthnmon', 10, '/root/git/healthnmon/healthnmon/log.py',
                117, 'foo', None, exc_info)
            result = formatter.formatException(exc_info, logrecord)
            self.assert_(True)