forked from ExpDev07/coronavirus-tracker-api
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest_countrycodes.py
More file actions
22 lines (19 loc) · 982 Bytes
/
test_countrycodes.py
File metadata and controls
22 lines (19 loc) · 982 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import pytest
from app.utils import countrycodes
"""
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"),
("BlaBla", "XX")])
def test_countrycodes_is_3166_1(country_name, expected_country_code):
assert countrycodes.country_code(country_name) == expected_country_code
@pytest.mark.parametrize("country_name_synonym, expected_country_code", [
("Deutschland", "DE"),
("Iran (Islamic Republic of)", "IR"),
("British Virgin Islands", "VG")])
def test_countrycodes_synonym(country_name_synonym, expected_country_code):
assert countrycodes.country_code(country_name_synonym) == expected_country_code