Пример #1
0
class EndStopCheckTest(CheckTestCase):
    check = EndStopCheck()

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

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

    def test_hindi(self):
        self.do_test(False, ("Text.", "Text।", ""), "hi")
        self.do_test(True, ("Text.", "Text", ""), "hi")

    def test_armenian(self):
        self.do_test(False, ("Text:", "Text`", ""), "hy")
        self.do_test(False, ("Text:", "Text՝", ""), "hy")
        self.do_test(True, ("Text.", "Text", ""), "hy")

    def test_santali(self):
        self.do_test(False, ("Text.", "Text.", ""), "sat")
        self.do_test(False, ("Text.", "Text᱾", ""), "sat")
        self.do_test(True, ("Text.", "Text", ""), "sat")
Пример #2
0
class EndStopCheckTest(CheckTestCase):
    check = EndStopCheck()

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

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

    def test_hindi(self):
        self.do_test(False, ('Text.', 'Text।', ''), 'hi')
        self.do_test(True, ('Text.', 'Text', ''), 'hi')

    def test_armenian(self):
        self.do_test(False, ('Text:', 'Text`', ''), 'hy')
        self.do_test(False, ('Text:', 'Text՝', ''), 'hy')
        self.do_test(True, ('Text.', 'Text', ''), 'hy')