From 41de7ca879108b46aebc708f96bbfe1c9515ffaa Mon Sep 17 00:00:00 2001 From: Steven Hiscocks Date: Sun, 16 Mar 2014 21:14:54 +0000 Subject: [PATCH] TST: Fix test failing due to wrapping of long subject lines v2 Another fix based from c7df15f014e15251f09205218d6b0c0f7908a69d which failed due to python3.3 not wrapping headers to 78 characters. --- fail2ban/tests/action_d/test_smtp.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/fail2ban/tests/action_d/test_smtp.py b/fail2ban/tests/action_d/test_smtp.py index dbad4493..f1fe7bd8 100644 --- a/fail2ban/tests/action_d/test_smtp.py +++ b/fail2ban/tests/action_d/test_smtp.py @@ -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)