mirror of
https://github.com/fail2ban/fail2ban.git
synced 2026-03-11 08:55:31 +00:00
TST: Fix test failing due to wrapping of log subject lines
Typically flagged by pypy due to what appears to be typically longer
object "ids" compared to python{2,3}
This commit is contained in:
parent
e193e67718
commit
c7df15f014
1 changed files with 5 additions and 2 deletions
|
|
@ -23,6 +23,7 @@ import asyncore
|
|||
import threading
|
||||
import unittest
|
||||
import sys
|
||||
from textwrap import wrap
|
||||
if sys.version_info >= (3, 3):
|
||||
import importlib
|
||||
else:
|
||||
|
|
@ -100,9 +101,11 @@ class SMTPActionTest(unittest.TestCase):
|
|||
self.action.ban(aInfo)
|
||||
self.assertEqual(self.smtpd.mailfrom, "fail2ban")
|
||||
self.assertEqual(self.smtpd.rcpttos, ["root"])
|
||||
self.assertTrue(
|
||||
subject = "\n".join(wrap(
|
||||
"Subject: [Fail2Ban] %s: banned %s" %
|
||||
(self.jail.name, aInfo['ip']) in self.smtpd.data)
|
||||
(self.jail.name, aInfo['ip']),
|
||||
78, subsequent_indent=" "))
|
||||
self.assertTrue(subject in self.smtpd.data)
|
||||
self.assertTrue(
|
||||
"%i attempts" % aInfo['failures'] in self.smtpd.data)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue