コード例 #1
0
ファイル: tests.py プロジェクト: christian-posta/cptextutils
    def test_mark_sentence_case(self):
        data = '''STRINGS IN ALL CAPS ARE HARD TO READ! SOME PEOPLE THINK
        THEY ARE LIKE SHOUTING!! WHAT DO YOU THINK ABOUT THAT?'''

        expected_data = '''Strings in all caps are hard to read! Some people think
        they are like shouting!! What do you think about that?'''

        sentence_case = mark_sentence_case(data)
        print len(sentence_case), len(data)
        print sentence_case

        self.assertEqual(expected_data, sentence_case)
コード例 #2
0
ファイル: tests.py プロジェクト: christian-posta/cptextutils
    def test_original_string(self):
        data = '''STRINGS IN ALL CAPS ARE HARD TO READ! SOME PEOPLE THINK THEY ARE LIKE SHOUTING. DO YOU THINK SO? I ONLY WRITE THEM WHEN I HAVE A CAPS-LOCK ACCIDENT. (OR WHEN CREATING TEST DATA.) THEY ARE NO FUN. (OK, ENOUGH NOW.)'''
        expected_data = '''Strings in all caps are hard to read! Some people think they are like shouting. Do you think so? I only write them when I have a caps-lock accident. (Or when creating test data.) They are no fun. (Ok, enough now.)'''

        sentence_case = mark_sentence_case(data)
        self.assertEqual(expected_data, sentence_case)
コード例 #3
0
ファイル: tests.py プロジェクト: christian-posta/cptextutils
 def test_smaller_string(self):
     data = '''this is my! test? no...'''
     expected_data = '''This is my! Test? No...'''
     sentence_case = mark_sentence_case(data)
     self.assertEqual(expected_data, sentence_case)