summaryrefslogtreecommitdiff
path: root/src/mailman/testing/helpers.py
diff options
context:
space:
mode:
authorBarry Warsaw2011-05-25 21:30:56 -0400
committerBarry Warsaw2011-05-25 21:30:56 -0400
commit0795e34d56a8f627348730843210cdba4071b26b (patch)
treee0eb6db1731e849d07c96c9deb00094f2b90f437 /src/mailman/testing/helpers.py
parent9887ba03016bbbd3a52d4a7df4f07906e984f431 (diff)
downloadmailman-0795e34d56a8f627348730843210cdba4071b26b.tar.gz
mailman-0795e34d56a8f627348730843210cdba4071b26b.tar.zst
mailman-0795e34d56a8f627348730843210cdba4071b26b.zip
Diffstat (limited to 'src/mailman/testing/helpers.py')
-rw-r--r--src/mailman/testing/helpers.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/mailman/testing/helpers.py b/src/mailman/testing/helpers.py
index 9f9ea6181..ed579e39c 100644
--- a/src/mailman/testing/helpers.py
+++ b/src/mailman/testing/helpers.py
@@ -20,6 +20,7 @@ from __future__ import absolute_import, unicode_literals
__metaclass__ = type
__all__ = [
+ 'LogFileMark',
'TestableMaster',
'call_api',
'digest_mbox',
@@ -39,6 +40,7 @@ import time
import errno
import signal
import socket
+import logging
import smtplib
import datetime
import threading
@@ -371,7 +373,7 @@ def reset_the_world():
config.db.commit()
# Reset the global style manager.
config.style_manager.populate()
-
+
def specialized_message_from_string(unicode_text):
@@ -391,3 +393,16 @@ def specialized_message_from_string(unicode_text):
message = message_from_string(text, Message)
message.original_size = original_size
return message
+
+
+
+class LogFileMark:
+ def __init__(self, log_name):
+ self._log = logging.getLogger(log_name)
+ self._filename = self._log.handlers[0].filename
+ self._filepos = os.stat(self._filename).st_size
+
+ def readline(self):
+ with open(self._filename) as fp:
+ fp.seek(self._filepos)
+ return fp.readline()