def test_first_last(self): line = 'Test Person' contacts = extract_contacts(line) one = Contact( name='Test Person' ) answer = [one] self.assertContactsEqual(answer, contacts)
def test_last_comma_first(self): line = 'Sixon, Antonio C.' contacts = extract_contacts(line) one = Contact( name='Antonio C. Sixon' ) answer = [one] self.assertContactsEqual(answer, contacts)
def test_email_only(self): line = '*****@*****.**' contacts = extract_contacts(line) one = Contact( email='*****@*****.**' ) answer = [one] self.assertContactsEqual(answer, contacts)
def test_name_phone_with_space(self): line = 'Test Person (123)-456-7890' contacts = extract_contacts(line) person = Contact( name='Test Person', phone='1234567890', ) answer = [person] self.assertContactsEqual(answer, contacts)
def test_semicolon_phone(self): line = 'Carolyn M. Blake 817-978-4661 ; Kelly M Pippin 817-850-5774' contacts = extract_contacts(line) carolyn = Contact( name='Carolyn M. Blake', phone='8179784661', ) kelly = Contact( name='Kelly M Pippin', phone='8178505774', ) answer = [carolyn, kelly] self.assertContactsEqual(answer, contacts)
def test_double_name(self): line = 'Hal Hayes 619-532-1251 Hal Hayes, Contract Specialist, [email protected],<a href="mailto:[email protected]">[email protected]</a>' contacts = extract_contacts(line) answer = [ Contact( name = 'Hal Hayes', phone = '6195321251', title = 'Contract Specialist', email = '*****@*****.**', ) ] self.assertContactsEqual(answer, contacts)
def test_double_name(self): line = 'Hal Hayes 619-532-1251 Hal Hayes, Contract Specialist, [email protected],<a href="mailto:[email protected]">[email protected]</a>' contacts = extract_contacts(line) answer = [ Contact( name='Hal Hayes', phone='6195321251', title='Contract Specialist', email='*****@*****.**', ) ] self.assertContactsEqual(answer, contacts)
def test_normal(self): line = 'Tina L. Watsontarver, Contract Specialist, Email [email protected], Phone (123)456-7890 - Jaclyn G. Rodriguez, Contracting Officer, Email [email protected]' contacts = extract_contacts(line) tina = Contact( name='Tina L. Watsontarver', title='Contract Specialist', email='*****@*****.**', phone='1234567890', ) jaclyn = Contact(name='Jaclyn G. Rodriguez', title='Contracting Officer', email='*****@*****.**') answer = [tina, jaclyn] self.assertContactsEqual(answer, contacts)
def test_normal(self): line = 'Tina L. Watsontarver, Contract Specialist, Email [email protected], Phone (123)456-7890 - Jaclyn G. Rodriguez, Contracting Officer, Email [email protected]' contacts = extract_contacts(line) tina = Contact( name='Tina L. Watsontarver', title='Contract Specialist', email='*****@*****.**', phone='1234567890', ) jaclyn = Contact( name='Jaclyn G. Rodriguez', title='Contracting Officer', email='*****@*****.**' ) answer = [tina, jaclyn] self.assertContactsEqual(answer, contacts)
def test_last_comma_first(self): line = 'Sixon, Antonio C.' contacts = extract_contacts(line) one = Contact(name='Antonio C. Sixon') answer = [one] self.assertContactsEqual(answer, contacts)
def test_first_last(self): line = 'Test Person' contacts = extract_contacts(line) one = Contact(name='Test Person') answer = [one] self.assertContactsEqual(answer, contacts)
def test_email_only(self): line = '*****@*****.**' contacts = extract_contacts(line) one = Contact(email='*****@*****.**') answer = [one] self.assertContactsEqual(answer, contacts)