mirror of https://github.com/fail2ban/fail2ban
TST: Fix test failing due to wrapping of long subject lines v2
Another fix based from c7df15f014
which
failed due to python3.3 not wrapping headers to 78 characters.
pull/652/head
parent
c7df15f014
commit
41de7ca879
|
@ -101,11 +101,9 @@ class SMTPActionTest(unittest.TestCase):
|
||||||
self.action.ban(aInfo)
|
self.action.ban(aInfo)
|
||||||
self.assertEqual(self.smtpd.mailfrom, "fail2ban")
|
self.assertEqual(self.smtpd.mailfrom, "fail2ban")
|
||||||
self.assertEqual(self.smtpd.rcpttos, ["root"])
|
self.assertEqual(self.smtpd.rcpttos, ["root"])
|
||||||
subject = "\n".join(wrap(
|
subject = "Subject: [Fail2Ban] %s: banned %s" % (
|
||||||
"Subject: [Fail2Ban] %s: banned %s" %
|
self.jail.name, aInfo['ip'])
|
||||||
(self.jail.name, aInfo['ip']),
|
self.assertTrue(subject in self.smtpd.data.replace("\n", ""))
|
||||||
78, subsequent_indent=" "))
|
|
||||||
self.assertTrue(subject in self.smtpd.data)
|
|
||||||
self.assertTrue(
|
self.assertTrue(
|
||||||
"%i attempts" % aInfo['failures'] in self.smtpd.data)
|
"%i attempts" % aInfo['failures'] in self.smtpd.data)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue