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

test_name_and_address_format()   A

Complexity

Conditions 1

Size

Total Lines 11
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 9
nop 3
dl 0
loc 11
rs 9.95
c 0
b 0
f 0
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