def test_loaded_equals_saved(self): 'Test that words loaded from a file match those saved' saveWords(self.file, self.sample) self.assertEqual(self.sample, loadWords(self.file)) os.remove(self.file)
def bookToWords(bookPath, wordsPath): ''' Read a file with text (a book) and write out the vocabulary into a file of JSON. ''' words = openBook(bookPath) uwords = uniqueWords(words) saveWords(wordsPath, uwords)