コード例 #1
0
    def test_a_count_of_words(self):
        self._write("Keep the bar green to keep the code clean.", TEST_FILE)

        counter = WordCounter.load(TEST_FILE)
        self.assertEqual(9, counter.number_of_words())

        os.remove(TEST_FILE)
コード例 #2
0
 def word_count_of_missing_file():
     WordCounter.load("DoesNotExist.txt")
コード例 #3
0
 def test_containment_of_word(self):
     counter = WordCounter.load(TEST_FILE)
コード例 #4
0
 def test_count_of_words_better(self):
     counter = WordCounter.load(TEST_FILE)