Exemplo n.º 1
0
def filter_valid_emails(emails):
    valid_emails = []
    for email in emails:
        try:
            validate_email(email)
        except ValueError as exc:
            print(exc)
        else:
            valid_emails.append(email)
    return valid_emails
Exemplo n.º 2
0
def test_extension_invalid_chars_raise_exception():
    with pytest.raises(ValueError):
        validate_email("*****@*****.**")
Exemplo n.º 3
0
def test_website_invalid_chars_raise_exception():
    with pytest.raises(ValueError):
        validate_email("abc@website!123.com")
Exemplo n.º 4
0
def test_extension_should_contain_only_three_chars():
    assert validate_email("*****@*****.**") is None
Exemplo n.º 5
0
def test_username_is_invalid_raise_exception():
    with pytest.raises(ValueError):
        validate_email("*****@*****.**")
Exemplo n.º 6
0
def test_website_contain_only_letters_and_digits():
    assert validate_email("*****@*****.**") is None
Exemplo n.º 7
0
def test_username_when_dont_start_with_letter_raise_exception():
    with pytest.raises(ValueError):
        validate_email("*****@*****.**")
Exemplo n.º 8
0
def test_username_should_starts_with_letter():
    assert validate_email("*****@*****.**") is None
Exemplo n.º 9
0
def test_username_can_contain_letters_digits_dashes_and_underscores():
    assert validate_email("*****@*****.**") is None
Exemplo n.º 10
0
def test_username_can_contain_letters_and_digits():
    assert validate_email("*****@*****.**") is None
Exemplo n.º 11
0
def test_username_can_only_contain_letters():
    assert validate_email("*****@*****.**") is None