-
-
Notifications
You must be signed in to change notification settings - Fork 312
Expand file tree
/
Copy pathtest_countries.py
More file actions
23 lines (19 loc) · 614 Bytes
/
test_countries.py
File metadata and controls
23 lines (19 loc) · 614 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import pytest
from app.utils import countries
"""
Todo:
* Test cases for capturing of stdout/stderr
"""
@pytest.mark.parametrize(
"country_name,expected_country_code",
[
("Germany", "DE"),
("Bolivia, Plurinational State of", "BO"),
("Korea, Democratic People's Republic of", "KP"),
("US", "US"),
("BlaBla", countries.DEFAULT_COUNTRY_CODE),
("Others", countries.DEFAULT_COUNTRY_CODE),
],
)
def test_countries_country_name__country_code(country_name, expected_country_code):
assert countries.country_code(country_name) == expected_country_code