def check_email_array(email_array): valid_emails = [] for email in email_array: try: validate_email(email) except ValueError as exc: print(exc) else: valid_emails.append(email) return valid_emails
def test_username_should_contain_letter_digits_dashes_or_underscore(): assert validate_email("*****@*****.**") is None
def test_username_should_start_with_letter(): assert validate_email("*****@*****.**") is None
def test_extension_invalid_raises_exception(): with pytest.raises(ValueError): validate_email("*****@*****.**")
def test_website_invalid_raises_exception(): with pytest.raises(ValueError): validate_email("leonardo@#$&.com")
def test_userame_invalid_raises_exception(): with pytest.raises(ValueError): validate_email("423$%$#@website.com")
def test_extension_should_contain_maximum_three_digits(): assert validate_email("*****@*****.**") is None
def test_website_should_contain_letter_and_digits(): assert validate_email("*****@*****.**") is None