Example #1
0
 def test_simple_mostCommonWords(self):
     self.assertEqual(mostCommonWords('simple.txt'), {
         'worda': 5,
         'wordb': 4,
         'wordc': 3,
         'wordd': 2,
         'worde': 1
     })
Example #2
0
 def test_punctuation_mostCommonWords(self):
     self.assertEqual(mostCommonWords('punctuation.txt'), {
         'worda': 5,
         'wordb': 4,
         'wordc': 3,
         'wordd': 2,
         'worde': 1
     })
Example #3
0
 def test_capitals_mostCommonWords(self):
     self.assertEqual(mostCommonWords('capitals.txt'), {
         'worda': 5,
         'wordb': 4,
         'wordc': 3,
         'wordd': 2,
         'worde': 1
     })
Example #4
0
 def test_multiline_mostCommonWords(self):
     self.assertEqual(mostCommonWords('multiline.txt'), {
         'worda': 5,
         'wordb': 4,
         'wordc': 3,
         'wordd': 2,
         'worde': 1
     })
Example #5
0
 def test_morethanten_mostCommonWords(self):
     self.assertEqual(
         mostCommonWords('morethanten.txt'), {
             'word1': 2,
             'word2': 2,
             'word3': 2,
             'word4': 2,
             'word5': 2,
             'word6': 2,
             'word7': 2,
             'word8': 2,
             'word9': 2,
             'word10': 2,
         })
Example #6
0
 def test_contractions_mostCommonWords(self):
     self.assertEqual(mostCommonWords('contractions.txt'), {
         "doesnt": 2,
         "isnt": 1
     })