コード例 #1
0
ファイル: test_log.py プロジェクト: emonty/healthnmon
    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)
コード例 #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)
コード例 #3
0
ファイル: test_log.py プロジェクト: emonty/healthnmon
    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)
コード例 #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)
コード例 #5
0
ファイル: test_log.py プロジェクト: emonty/healthnmon
    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)
コード例 #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)