def test_multiple_recipients_delivered_to(self): email_parser = EmailParser(self.log) msg = { "Delivered-To": "<*****@*****.**> bob smith, <*****@*****.**> robert the bruce" } rcpt = email_parser.get_recipients(msg) self.assertEqual(rcpt, ["*****@*****.**", "*****@*****.**"])
def test_recipients_not_available(self): email_parser = EmailParser(self.log) msg = {} rcpt = email_parser.get_recipients(msg) self.assertEqual(rcpt, [])
def test_no_recipients(self): email_parser = EmailParser(self.log) msg = {"To": ""} rcpt = email_parser.get_recipients(msg) self.assertEqual(rcpt, [])
def test_single_recipient(self): email_parser = EmailParser(self.log) msg = {"To": "*****@*****.**"} rcpt = email_parser.get_recipients(msg) self.assertEqual(rcpt, ["*****@*****.**"])