2019-12-09 22:26:20 +01:00
|
|
|
from email_handler import get_email_name, get_email_part
|
2019-11-19 21:47:58 +01:00
|
|
|
|
|
|
|
|
|
|
|
def test_get_email_name():
|
|
|
|
assert get_email_name("First Last <ab@cd.com>") == "First Last"
|
|
|
|
assert get_email_name("First Last<ab@cd.com>") == "First Last"
|
|
|
|
assert get_email_name(" First Last <ab@cd.com>") == "First Last"
|
|
|
|
assert get_email_name("ab@cd.com") == ""
|
2019-12-09 22:26:20 +01:00
|
|
|
|
|
|
|
|
|
|
|
def test_get_email_part():
|
|
|
|
assert get_email_part("First Last <ab@cd.com>") == "ab@cd.com"
|
|
|
|
assert get_email_part("First Last<ab@cd.com>") == "ab@cd.com"
|
|
|
|
assert get_email_part(" First Last <ab@cd.com>") == "ab@cd.com"
|
|
|
|
assert get_email_part("ab@cd.com") == "ab@cd.com"
|