From 38b33a71e049f29743ce1805b82d4f048e466ce6 Mon Sep 17 00:00:00 2001 From: Lindsey Smith Date: Mon, 14 Mar 2011 09:19:12 -0700 Subject: [PATCH] Initial revision --- test_rss2email.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 test_rss2email.py diff --git a/test_rss2email.py b/test_rss2email.py new file mode 100644 index 0000000..44e14c0 --- /dev/null +++ b/test_rss2email.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +"""Unit tests for rss2email. + +These tests make sure that rss2email works as it should. If you +find a bug, the best way to express it is as a test +case like this that fails.""" + +import unittest +from rss2email import * + +class Test_validateEmail(unittest.TestCase): + """""" + def test_valid_email(self): + email = validateEmail("valid@example.com", "planb@example.com") + self.assertEqual(email, "valid@example.com") + + def test_no_mail_server(self): + email = validateEmail("invalid", "planb@example.com") + self.assertEqual(email, "planb@example.com") + + def test_no_email_name(self): + email = validateEmail("@invalid", "planb@example.com") + self.assertEqual(email, "planb@example.com") + + def test_no_at(self): + email = validateEmail("invalid", "planb@example.com") + self.assertEqual(email, "planb@example.com") + +if __name__ == '__main__': + unittest.main() -- 2.26.2