def test_complex_text(self): freq = word_frequency(gettysburg_address) self.assertEqual(freq["dedicated"], 4) self.assertEqual(freq["great"], 3) self.assertEqual(freq["devotion"], 2)
def test_simple_text(self): freq = word_frequency("buffalo buffalo buffalo buffalo buffalo " "buffalo buffalo") self.assertEqual(freq["buffalo"], 7)