コード例 #1
0
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
コード例 #2
0
def test_username_should_contain_letter_digits_dashes_or_underscore():
    assert validate_email("*****@*****.**") is None
コード例 #3
0
def test_username_should_start_with_letter():
    assert validate_email("*****@*****.**") is None
コード例 #4
0
def test_extension_invalid_raises_exception():
    with pytest.raises(ValueError):
        validate_email("*****@*****.**")
コード例 #5
0
def test_website_invalid_raises_exception():
    with pytest.raises(ValueError):
        validate_email("leonardo@#$&.com")
コード例 #6
0
def test_userame_invalid_raises_exception():
    with pytest.raises(ValueError):
        validate_email("423$%$#@website.com")
コード例 #7
0
def test_extension_should_contain_maximum_three_digits():
    assert validate_email("*****@*****.**") is None
コード例 #8
0
def test_website_should_contain_letter_and_digits():
    assert validate_email("*****@*****.**") is None