Skip to content

Commit 1f9acbb

Browse files
author
spirit
committed
Move country codes test to its own class.
1 parent 631ba50 commit 1f9acbb

1 file changed

Lines changed: 27 additions & 25 deletions

File tree

‎test.py‎

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -52,30 +52,6 @@ class TestLanguageTool(unittest.TestCase):
5252
],
5353
}
5454

55-
country_tests = {
56-
"Australian": "AU",
57-
"Canadian": "CA",
58-
"GB": "GB",
59-
"New Zealand": "NZ",
60-
"South African": "ZA",
61-
"US": "US",
62-
"Austria": "AT",
63-
"Germany": "DE",
64-
"Swiss": "CH",
65-
"Brazil": "BR",
66-
"Portugal": "PT",
67-
68-
"Australia": "AU",
69-
"Canada": "CA",
70-
"United Kingdom": "GB",
71-
"South Africa": "ZA",
72-
"United States": "US",
73-
"Switzerland": "CH",
74-
75-
"Austrian": "AT",
76-
"Brazilian": "BR",
77-
}
78-
7955
def test_samples(self):
8056
languages = language_tool.get_languages()
8157
for language, tests in self.tests.items():
@@ -109,8 +85,34 @@ def test_version(self):
10985
version = language_tool.get_version()
11086
self.assertTrue(version)
11187

88+
89+
class TestCountryCodes(unittest.TestCase):
90+
tests = {
91+
"Australian": "AU",
92+
"Canadian": "CA",
93+
"GB": "GB",
94+
"New Zealand": "NZ",
95+
"South African": "ZA",
96+
"US": "US",
97+
"Austria": "AT",
98+
"Germany": "DE",
99+
"Swiss": "CH",
100+
"Brazil": "BR",
101+
"Portugal": "PT",
102+
103+
"Australia": "AU",
104+
"Canada": "CA",
105+
"United Kingdom": "GB",
106+
"South Africa": "ZA",
107+
"United States": "US",
108+
"Switzerland": "CH",
109+
110+
"Austrian": "AT",
111+
"Brazilian": "BR",
112+
}
113+
112114
def test_country_codes(self):
113-
for country, code in self.country_tests.items():
115+
for country, code in self.tests.items():
114116
self.assertEqual(get_country_code(country), code)
115117

116118

0 commit comments

Comments
 (0)