Skip to content

Commit

Permalink
Clean up asserts.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Howitz committed Aug 17, 2018
1 parent 544dc47 commit c32a504
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/Products/MailHost/tests/testMailHost.py
Expand Up @@ -68,8 +68,8 @@ def testAllHeaders(self):
This is the message body."""
# No additional info
resmsg, resto, resfrom = _mungeHeaders(msg)
self.assertTrue(resto == ['recipient@domain.com'])
self.assertTrue(resfrom == 'sender@domain.com')
self.assertEqual(resto, ['recipient@domain.com'])
self.assertEqual(resfrom, 'sender@domain.com')

# Add duplicated info
resmsg, resto, resfrom = _mungeHeaders(
Expand All @@ -90,20 +90,20 @@ def testMissingHeaders(self):
This is the message body."""
# Doesn't specify to
self.assertRaises(MailHostError, _mungeHeaders, msg,
mfrom='sender@domain.com')
with self.assertRaises(MailHostError):
_mungeHeaders(msg, mfrom='sender@domain.com')
# Doesn't specify from
self.assertRaises(MailHostError, _mungeHeaders, msg,
mto='recipient@domain.com')
with self.assertRaises(MailHostError):
_mungeHeaders(msg, mto='recipient@domain.com')

def testNoHeaders(self):
msg = """This is the message body."""
# Doesn't specify to
self.assertRaises(MailHostError, _mungeHeaders, msg,
mfrom='sender@domain.com')
with self.assertRaises(MailHostError):
_mungeHeaders(msg, mfrom='sender@domain.com')
# Doesn't specify from
self.assertRaises(MailHostError, _mungeHeaders, msg,
mto='recipient@domain.com')
with self.assertRaises(MailHostError):
_mungeHeaders(msg, mto='recipient@domain.com')
# Specify all
resmsg, resto, resfrom = _mungeHeaders(
msg, 'recipient2@domain.com',
Expand Down

0 comments on commit c32a504

Please sign in to comment.