예제 #1
0
class EndColonCheckTest(CheckTestCase):
    check = EndColonCheck()

    def setUp(self):
        super(EndColonCheckTest, self).setUp()
        self.test_good_matching = ('string:', 'string:', '')
        self.test_failure_1 = ('string:', 'string', '')
        self.test_failure_2 = ('string', 'string:', '')

    def test_hy(self):
        self.do_test(False, ('Text:', 'Texte՝', ''), 'hy')
        self.do_test(True, ('Text:', 'Texte', ''), 'hy')
        self.do_test(False, ('Text', 'Texte:', ''), 'hy')

    def test_japanese(self):
        self.do_test(False, ('Text:', 'Texte。', ''), 'ja')

    def test_japanese_ignore(self):
        self.do_test(False, ('Text', 'Texte', ''), 'ja')

    def test_french_1(self):
        self.do_test(False, ('Text:', 'Texte : ', ''), 'fr')

    def test_french_2(self):
        self.do_test(False, ('Text:', 'Texte :', ''), 'fr')

    def test_french_ignore(self):
        self.do_test(False, ('Text', 'Texte', ''), 'fr')

    def test_french_wrong(self):
        self.do_test(True, ('Text:', 'Texte:', ''), 'fr')
예제 #2
0
class EndColonCheckTest(CheckTestCase):
    check = EndColonCheck()

    def setUp(self):
        super().setUp()
        self.test_good_matching = ("string:", "string:", "")
        self.test_failure_1 = ("string:", "string", "")
        self.test_failure_2 = ("string", "string:", "")

    def test_hy(self):
        self.do_test(False, ("Text:", "Texte՝", ""), "hy")
        self.do_test(True, ("Text:", "Texte", ""), "hy")
        self.do_test(False, ("Text", "Texte:", ""), "hy")

    def test_japanese(self):
        self.do_test(False, ("Text:", "Texte。", ""), "ja")

    def test_japanese_ignore(self):
        self.do_test(False, ("Text", "Texte", ""), "ja")