def test_preprocessing_bag_of_words(self): """ bag_of_words will return a scipy.frequency_term.csr.csr_matrix so test for these attrs. """ preprocessor = TextPreprocessor(self.articles) x_train_counts = preprocessor.bag_of_words() self.assertTrue(hasattr(x_train_counts, 'shape'))