Example #1
0
 def testIgnoresNewlines(self):
     word_list = {'a': 1}
     to_test = """a
     """
     self.assertDictEqual(w.add_to_word_counter(to_test, word_list),
                          {'a': 2})
Example #2
0
 def testIgnoresPunctuation(self):
     word_list = {'a': 1}
     self.assertDictEqual(w.add_to_word_counter(".a", word_list), {'a': 2})
Example #3
0
 def testIgnoresCase(self):
     word_list = {'a': 1}
     self.assertDictEqual(w.add_to_word_counter("A", word_list), {'a': 2})
Example #4
0
 def testCreatesWordIfNotInDict(self):
     word_list = {}
     self.assertDictEqual(w.add_to_word_counter("a", word_list), {'a': 1})
Example #5
0
 def testAddsOneWordToCounter(self):
     word_list = {'a': 2}
     self.assertDictEqual(w.add_to_word_counter("a", word_list), {'a': 3})
Example #6
0
 def testAddingNoWordsAddsNoWords(self):
     word_list = {'a': 3}
     self.assertDictEqual(w.add_to_word_counter("", word_list), word_list)