File: test_validate_email.py

package info (click to toggle)
python-briefcase 0.3.22-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,300 kB
  • sloc: python: 59,405; makefile: 57
file content (24 lines) | stat: -rw-r--r-- 522 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import pytest


@pytest.mark.parametrize(
    "email",
    [
        "foo@example.com",
    ],
)
def test_valid_email(new_command, email):
    """Test that valid email addresses are accepted."""
    assert new_command.validate_email(email)


@pytest.mark.parametrize(
    "email",
    [
        "not a email address!",  # Free text.
    ],
)
def test_invalid_email(new_command, email):
    """Test that invalid email addresses are rejected."""
    with pytest.raises(ValueError):
        new_command.validate_email(email)