19 lines
462 B
Python
19 lines
462 B
Python
from librefi.utils import get_user_agent, get_email_address
|
|
import re
|
|
|
|
|
|
def test_email_address():
|
|
email = get_email_address()
|
|
assert isinstance(email, str)
|
|
assert re.search(
|
|
# intentionally dumb and not covering a lot of actual emails
|
|
r"^[a-zA-Z\d](?:[a-zA-Z\d._-]*[a-zA-Z\d])?@[a-z-\d]+(?:\.[a-z-\d]+)+$",
|
|
email) is not None
|
|
pass
|
|
|
|
|
|
def test_user_agent():
|
|
ua = get_user_agent()
|
|
assert isinstance(ua, str)
|
|
pass
|