Beispiel #1
0
class QtPluralCheckTest(CheckTestCase):
    check = QtPluralCheck()
    flag = 'qt-plural-format'

    def setUp(self):
        super(QtPluralCheckTest, self).setUp()
        self.test_highlight = (
            self.flag,
            '%Lnstring',
            [(0, 3, u'%Ln')],
        )

    def test_no_format(self):
        self.assertFalse(self.check.check_format('strins', 'string', False))

    def test_plural_format(self):
        self.assertFalse(
            self.check.check_format('%n string(s)', '%n string', False))

    def test_plural_localized_format(self):
        self.assertFalse(
            self.check.check_format('%Ln string(s)', '%Ln string', False))

    def test_missing_format(self):
        self.assertTrue(
            self.check.check_format('%n string(s)', 'string', False))
Beispiel #2
0
class QtPluralCheckTest(CheckTestCase):
    check = QtPluralCheck()
    flag = "qt-plural-format"

    def setUp(self):
        super().setUp()
        self.test_highlight = (self.flag, "%Lnstring", [(0, 3, "%Ln")])

    def test_no_format(self):
        self.assertFalse(self.check.check_format("strins", "string", False))

    def test_plural_format(self):
        self.assertFalse(self.check.check_format("%n string(s)", "%n string", False))

    def test_plural_localized_format(self):
        self.assertFalse(self.check.check_format("%Ln string(s)", "%Ln string", False))

    def test_missing_format(self):
        self.assertTrue(self.check.check_format("%n string(s)", "string", False))