Minor fix for importer adding @nottingham.ac.uk to empty emails.

Small test case for email fixer to make sure that emails are fixed correctly.
This commit is contained in:
tomtom5152
2015-01-27 16:51:58 +00:00
parent 75f9d2ffc4
commit 1aff7bcadb
2 changed files with 44 additions and 10 deletions

28
RIGS/importer_tests.py Normal file
View File

@@ -0,0 +1,28 @@
__author__ = 'ghost'
import unittest
from importer import fix_email
class EmailFixerTest(unittest.TestCase):
def test_correct(self):
e = fix_email("tom@ghost.uk.net")
self.assertEqual(e, "tom@ghost.uk.net")
def test_partial(self):
e = fix_email("psytp")
self.assertEqual(e, "psytp@nottingham.ac.uk")
def test_none(self):
old = None
new = fix_email(old)
self.assertEqual(old, new)
def test_empty(self):
old = ""
new = fix_email(old)
self.assertEqual(old, new)
if __name__ == '__main__':
unittest.main()