-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtests.py
29 lines (23 loc) · 806 Bytes
/
tests.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import unittest
import country_list
class TestCountryList(unittest.TestCase):
def test_available_languages(self):
self.assertEqual(
len(country_list.available_languages()),
628,
"Languages have been added/removed",
)
def test_countries(self):
self.assertEqual(
len(country_list.countries_for_language("sv_SE")),
249,
"Countries have been added/removed",
)
def test_invalid_country(self):
with self.assertRaises(ValueError):
country_list.countries_for_language("invalid")
def test_auto_format_language(self):
self.assertEqual(
country_list.countries_for_language("sv_SE"),
country_list.countries_for_language("sv-se"),
)