python-emailvalid/tests.py

38 lines
925 B
Python
Raw Permalink Normal View History

2012-11-08 12:02:11 +01:00
#This file is part of emailvalid. The COPYRIGHT file at the top level of
#this repository contains the full copyright notices and license terms.
'''
Unit test for emailvalid
'''
import unittest
import emailvalid
EMAILS = (
2012-11-13 11:07:13 +01:00
('username@domain.com, anotheruser@domain.com', True),
('username@domain.com; anotheruser@domain.com', True),
('username@domain.com;anotheruser@domain.com', True),
('username@domain', False),
('another,user@domain.com', False),
('another;user@domain.com', False),
2012-11-08 12:02:11 +01:00
)
2012-11-13 11:07:13 +01:00
2012-11-08 12:02:11 +01:00
class BankNumberTest(unittest.TestCase):
'''
Test Case for emailvalid
'''
def test_emails(self):
'''
Test eMails
'''
for email, result in EMAILS:
if result:
test = self.assert_
else:
test = self.assertFalse
test(emailvalid.check_email(email))
if __name__ == '__main__':
unittest.main()