Example #1
0
    def test_log_healthnmon_audit_formatter_format_without_optional_values(self):
        formatter = HealthnmonAuditFormatter()

        logrecord = logging.LogRecord('healthnmon', 10, '/root/git/healthnmon/healthnmon/log.py', 117, 'foo', None, None)
        logrecord.asctime = time.time()
        result = formatter.format(logrecord)
        self.assert_(True)
Example #2
0
    def test_log_healthnmon_audit_formatter_format_without_optional_values(
            self):
        formatter = HealthnmonAuditFormatter()

        logrecord = logging.LogRecord(
            'healthnmon', 10, '/root/git/healthnmon/healthnmon/log.py', 117,
            'foo', None, None)
        logrecord.asctime = time.time()
        result = formatter.format(logrecord)
        self.assert_(True)
Example #3
0
    def test_log_healthnmon_audit_formatter(self):
        formatter = HealthnmonAuditFormatter()

        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)
            logrecord.asctime = time.time()
            logrecord.instance = exc_info
            result = formatter.format(logrecord)
            self.assert_(True)
Example #4
0
    def test_log_healthnmon_audit_formatter(self):
        formatter = HealthnmonAuditFormatter()

        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)
            logrecord.asctime = time.time()
            logrecord.instance = exc_info
            result = formatter.format(logrecord)
            self.assert_(True)
Example #5
0
    def test_log_healthnmon_audit_formatter_format_with_optional_values(self):
        formatter = HealthnmonAuditFormatter()

        logrecord = logging.LogRecord('healthnmon', 10, '/root/git/healthnmon/healthnmon/log.py', 117, 'foo', None, None)
        logrecord.componentId = "Healthnmon"
        logrecord.orgId = "TestOrgId"
        logrecord.domain = "TestDomain"
        logrecord.userId = "TestUserId"
        logrecord.loggingId = "L123"
        logrecord.taskId = "T123"
        logrecord.sourceIp = "localhost"
        logrecord.result = "SUCCESS"
        logrecord.action = "NOOP"
        logrecord.severity = "INFO"
        logrecord.object = "TestObject"
        logrecord.objectDescription = "TestDescription"
        logrecord.asctime = time.time()
        result = formatter.format(logrecord)
        self.assert_(True)
Example #6
0
    def test_log_healthnmon_audit_formatter_format_with_optional_values(self):
        formatter = HealthnmonAuditFormatter()

        logrecord = logging.LogRecord(
            'healthnmon', 10, '/root/git/healthnmon/healthnmon/log.py', 117,
            'foo', None, None)
        logrecord.componentId = "Healthnmon"
        logrecord.orgId = "TestOrgId"
        logrecord.domain = "TestDomain"
        logrecord.userId = "TestUserId"
        logrecord.loggingId = "L123"
        logrecord.taskId = "T123"
        logrecord.sourceIp = "localhost"
        logrecord.result = "SUCCESS"
        logrecord.action = "NOOP"
        logrecord.severity = "INFO"
        logrecord.object = "TestObject"
        logrecord.objectDescription = "TestDescription"
        logrecord.asctime = time.time()
        result = formatter.format(logrecord)
        self.assert_(True)