diff --git a/tests/string_generators.py b/tests/string_generators.py new file mode 100644 index 0000000..a0c3bdb --- /dev/null +++ b/tests/string_generators.py @@ -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