MCPcopy Create free account
hub / github.com/StackStorm/st2 / test_log_critical

Method test_log_critical

st2common/tests/unit/test_logger.py:116–125  ·  view source on GitHub ↗

Test that CRITICAL log entry does not go to the audit log.

(self)

Source from the content-addressed store, hash-verified

114 self.assertNotIn(msg, audit_log_entries)
115
116 def test_log_critical(self):
117 """Test that CRITICAL log entry does not go to the audit log."""
118 logging.setup(self.cfg_path)
119 log = logging.getLogger(__name__)
120 msg = uuid.uuid4().hex
121 log.critical(msg)
122 info_log_entries = open(self.info_log_path).read()
123 self.assertIn(msg, info_log_entries)
124 audit_log_entries = open(self.audit_log_path).read()
125 self.assertNotIn(msg, audit_log_entries)
126
127 def test_log_audit(self):
128 """Test that AUDIT log entry goes to the audit log."""

Callers

nothing calls this directly

Calls 3

getLoggerMethod · 0.80
setupMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected