Passed
Push — main ( 5a1833...1f94b4 )
by Jochen
05:05
created

tests.unit.services.email.test_name_and_address_format   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 22
rs 10
c 0
b 0
f 0
wmc 1

1 Function

Rating   Name   Duplication   Size   Complexity  
A test_name_and_address_format() 0 11 1
1
"""
2
:Copyright: 2006-2021 Jochen Kupperschmidt
3
:License: Revised BSD (see `LICENSE` file for details)
4
"""
5
6
import pytest
7
8
from byceps.services.email.transfer.models import NameAndAddress
9
10
11
@pytest.mark.parametrize(
12
    'name, address, expected',
13
    [
14
        (None, '[email protected]', '[email protected]'),
15
        ('Simple', '[email protected]', 'Simple <[email protected]>'),
16
        ('Mr. Pink', '[email protected]', '"Mr. Pink" <[email protected]>'),  # quotes name
17
    ],
18
)
19
def test_name_and_address_format(name, address, expected):
20
    name_and_address = NameAndAddress(name, address)
21
    assert name_and_address.format() == expected
22