Xqt has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1312270?usp=email )
Change subject: test: add tests for fallback dicts
......................................................................
test: add tests for fallback dicts
Test that every groupname of _LANG_TO_GROUP_NAME has a key in
_GROUP_NAME_TO_FALLBACKS
Change-Id: I2438dec5fff0a514e0da4a17e99f0460f65daa8b
---
M tests/i18n_tests.py
1 file changed, 16 insertions(+), 1 deletion(-)
Approvals:
jenkins-bot: Verified
Xqt: Looks good to me, approved
diff --git a/tests/i18n_tests.py b/tests/i18n_tests.py
index e4f0ef0..8066b42 100755
--- a/tests/i18n_tests.py
+++ b/tests/i18n_tests.py
@@ -31,9 +31,24 @@
self.family.name = family
+class TestFallbackDicts(TestCase):
+
+ """Test the fallback dicts."""
+
+ net = False
+
+ def test_groupnames(self):
+ """Test that groupnames are in groups."""
+ groupnames = set(i18n._LANG_TO_GROUP_NAME.values())
+ self.assertLess(groupnames, i18n._LANG_TO_GROUP_NAME.keys())
+ groups = list(i18n._GROUP_NAME_TO_FALLBACKS)
+ groups.remove('') # remove empty fallback
+ self.assertEqual(sorted(groupnames), groups)
+
+
class TestTranslate(TestCase):
- """Test translate method with fallback True."""
+ """Test translation lookup using family-specific localization."""
net = False
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1312270?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I2438dec5fff0a514e0da4a17e99f0460f65daa8b
Gerrit-Change-Number: 1312270
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]