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
Steven Hiscocks 2014-03-16 21:14:54 +00:00
parent c7df15f014
commit 41de7ca879
1 changed files with 3 additions and 5 deletions

View File

@ -101,11 +101,9 @@ class SMTPActionTest(unittest.TestCase):
self.action.ban(aInfo)
self.assertEqual(self.smtpd.mailfrom, "fail2ban")
self.assertEqual(self.smtpd.rcpttos, ["root"])
subject = "\n".join(wrap(
"Subject: [Fail2Ban] %s: banned %s" %
(self.jail.name, aInfo['ip']),
78, subsequent_indent=" "))
self.assertTrue(subject in self.smtpd.data)
subject = "Subject: [Fail2Ban] %s: banned %s" % (
self.jail.name, aInfo['ip'])
self.assertTrue(subject in self.smtpd.data.replace("\n", ""))
self.assertTrue(
"%i attempts" % aInfo['failures'] in self.smtpd.data)