Commit b6b64169 authored by Michal Čihař's avatar Michal Čihař

Add test for PluralsCheck

parent 4753656b
......@@ -30,7 +30,8 @@ from weblate.trans.checks import (
EndStopCheck, EndColonCheck,
EndQuestionCheck, EndExclamationCheck,
EndEllipsisCheck,
PythonFormatCheck, PHPFormatCheck, CFormatCheck
PythonFormatCheck, PHPFormatCheck, CFormatCheck,
PluralsCheck,
)
......@@ -624,3 +625,35 @@ class CFormatCheckTest(TestCase):
Language('cs'),
Unit('c_wrong_named_format')
))
class PluralsCheckTest(TestCase):
def setUp(self):
self.check = PluralsCheck()
def test_none(self):
self.assertFalse(self.check.check(
['string'],
['string'],
'',
Language('cs'),
None
))
def test_empty(self):
self.assertFalse(self.check.check(
['string', 'plural'],
['', ''],
'',
Language('cs'),
None
))
def test_partial_empty(self):
self.assertTrue(self.check.check(
['string', 'plural'],
['string', ''],
'',
Language('cs'),
None
))
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment