Example #1
0
 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')
Example #2
0
 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
Example #3
0
 def test_cut_attag(self):
     nick = '@mynick'
     result = utils.cut_attag(nick)
     self.assertEqual(result, 'mynick')