string generator utils unit testing
parent
95624a1257
commit
ad0970c95c
|
@ -0,0 +1,18 @@
|
|||
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
|
Loading…
Reference in New Issue