Пример #1
0
class EndQuestionCheckTest(CheckTestCase):
    check = EndQuestionCheck()

    def setUp(self):
        super(EndQuestionCheckTest, 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_french(self):
        self.do_test(False, ('Text?', 'Texte ?', ''), 'fr')
        self.do_test(False, ('Text?', 'Texte\u202F?', ''), 'fr')
        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')

    def test_greek(self):
        self.do_test(False, ('Text?', 'Texte;', ''), 'el')
        self.do_test(False, ('Text?', 'Texte;', ''), 'el')

    def test_greek_ignore(self):
        self.do_test(False, ('Text', 'Texte', ''), 'el')

    def test_greek_wrong(self):
        self.do_test(True, ('Text?', 'Texte', ''), 'el')
Пример #2
0
class EndQuestionCheckTest(CheckTestCase):
    check = EndQuestionCheck()

    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_greek(self):
        self.do_test(False, ("Text?", "Texte;", ""), "el")
        self.do_test(False, ("Text?", "Texte;", ""), "el")

    def test_greek_ignore(self):
        self.do_test(False, ("Text", "Texte", ""), "el")

    def test_greek_wrong(self):
        self.do_test(True, ("Text?", "Texte", ""), "el")

    def test_my(self):
        self.do_test(False, ("Text?", "Texte՞", ""), "my")
        self.do_test(False, ("Text", "Texte՞", ""), "my")
        self.do_test(True, ("Text?", "ပုံဖျက်မလား။", ""), "my")