def test_cut_attag(self): nick = '@mynick' result = utils.cut_attag(nick) self.assertEqual(result, 'mynick') nick = 'mynick' result = utils.cut_attag(nick) self.assertEqual(result, 'mynick')
def text_complete(self, text): """Return the text to insert after a completion.""" try: last_word = text.split()[-1] if last_word[0] is '@': nick = cut_attag(last_word) missing_text = self.complete(nick) return missing_text if missing_text else None except IndexError: pass
def test_cut_attag(self): nick = '@mynick' result = utils.cut_attag(nick) self.assertEqual(result, 'mynick')