Exemple #1
0
 def call(self, bot, item):
     parent = item.parent()
     item.reply(
         bot.reply_using_parent_of_mention(author_name(parent),
                                           get_text(parent)))
Exemple #2
0
 def call(self, bot, item):
     item.reply(bot.reply_to_mention(author_name(item), get_text(item)))
Exemple #3
0
 def is_tagged_in(self, item):
     # TODO should return True for messages & possibly other item types. But
     # those aren't supported yet, so not a huge deal.
     return self.bot_tag in get_text(item).lower()
 def test_get_text_when_does_not_have_any(self):
     with self.assertRaises(ValueError):
         get_text(Mock(spec=Subreddit))
 def test_get_text_when_comment(self):
     text = "sometext"
     s = Mock(spec=Comment)
     s.body = text
     assert text == get_text(s)
 def test_get_text_when_submission(self):
     text = "sometext"
     s = Mock(spec=Submission)
     s.selftext = text
     assert text == get_text(s)