Skip to content

Commit 2fa38cf

Browse files
committed
fix
1 parent 03c5bbc commit 2fa38cf

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

ckanext/push_errors/tests/test_utils.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,18 +75,20 @@ def test_get_error_log_id_from_exc_info():
7575
handler = ListHandler()
7676
logger.addHandler(handler)
7777

78-
# Ejecutar el log
78+
# Execute the log by raising and catching a custom error
7979
raise_custom_error_and_log()
8080

81-
# Asegurar que se capturó un registro
81+
# Ensure that at least one log record was captured
8282
assert len(handler.records) > 0, "Expected at least one log record"
8383

8484
log_record = handler.records[-1]
8585
log_id = get_error_log_id(log_record)
86+
# Check that the log ID does not start with "loghash:"
8687
assert not log_id.startswith("loghash:")
88+
# Check that the log ID contains a colon
8789
assert ":" in log_id
8890

89-
# Limpieza
91+
# Cleanup
9092
logger.removeHandler(handler)
9193

9294

@@ -102,14 +104,17 @@ def test_get_error_log_id_from_message_hash():
102104
handler = ListHandler()
103105
logger.addHandler(handler)
104106

105-
# Emitir log sin exc_info
107+
# Emit a log message without exc_info
106108
logger.critical("Some random critical error")
107109

108-
# Validar
110+
# Validate that a log record was captured
109111
assert len(handler.records) > 0
110112
log_record = handler.records[-1]
111113
log_id = get_error_log_id(log_record)
114+
# Check that the log ID starts with "loghash:"
112115
assert log_id.startswith("loghash:")
116+
# Check that the log ID is longer than 12 characters
113117
assert len(log_id) > 12
114118

119+
# Cleanup
115120
logger.removeHandler(handler)

0 commit comments

Comments
 (0)