1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
import pytest
@pytest.mark.parametrize(
"name, bundle, candidate",
[
("Jane Developer", "com.example", "jane@example.com"),
("Jane Developer", "com.example.more", "jane@more.example.com"),
("Jane", "com.example", "jane@example.com"),
],
)
def test_make_author_email(new_command, name, bundle, candidate):
"""An author name and bundle can be converted into a valid email address."""
email = new_command.make_author_email(name, bundle)
assert email == candidate
# Double check - the app name passes the validity check.
assert new_command.validate_email(email)
|