def test_iter_proper_data(self): bow = BagOfWords("ala ma kota ala ma ala") iterations = list(bow.__iter__()) self.assertEquals(iterations, ['ala', 'ma', 'kota'])
def test_iter_empty_bow(self): bow = BagOfWords("") iterations = list(bow.__iter__()) self.assertEquals(iterations, [''])
def test_iter_doubled_word(self): bow = BagOfWords("ala ala") iterations = list(bow.__iter__()) self.assertEquals(iterations, ['ala'])