jenkins-bot has submitted this change and it was merged.
Change subject: [IMPROV] i18n_tests: Assert equality
......................................................................
[IMPROV] i18n_tests: Assert equality
Instead of asserting an exception it could directly assert the result from
`twntranslate`. It's not testing that the %-operator is raising a `KeyError`
but it's testing that when not all parameters are applied it just applies
plural parameters.
Change-Id: Ifa02edeff1e70c278ec0011712135f538078a00a
---
M tests/i18n_tests.py
1 file changed, 4 insertions(+), 4 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/i18n_tests.py b/tests/i18n_tests.py
index 3b5340d..bac92a0 100644
--- a/tests/i18n_tests.py
+++ b/tests/i18n_tests.py
@@ -304,10 +304,10 @@
def testAllParametersExist(self):
"""Test that all parameters are required when using a
dict."""
- with self.assertRaisesRegex(KeyError, repr(u'line')):
- # all parameters must be inside twntranslate
- i18n.twntranslate('de', 'test-multiple-plurals',
- {'line': 1, 'page': 1}) %
{'action': u'Ă„ndere'}
+ # all parameters must be inside twntranslate
+ self.assertEqual(i18n.twntranslate('de',
'test-multiple-plurals',
+ {'line': 1, 'page': 1}),
+ 'Bot: %(action)s %(line)s Zeile von einer Seite.')
def test_fallback_lang(self):
"""
--
To view, visit
https://gerrit.wikimedia.org/r/244621
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ifa02edeff1e70c278ec0011712135f538078a00a
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Siebrand <siebrand(a)kitano.nl>
Gerrit-Reviewer: jenkins-bot <>