def test_text_preprocessing(self): text = "This is a sample text. # ! . " analyser = TextAnalyser() processed = analyser._preprocess(text) expected = ('This is a sample text. # ! . ', ['sampl', 'text'], [('sampl', 1), ('text', 1)]) self.assertEqual(expected, processed)