コード例 #1
0
    def test_get_emoji_returns_correct_custom_emoji(self):
        event = TestableEvent()
        self.config.update({
            'SLACK_CUSTOM_EMOJI_MAPPING': {
                'batman': 'joker'
            }
        })

        handler = SlackHandler(event, self.config)
        eq_(handler.get_emoji('batman'), ':joker:')
        # non custom emojis return the default response
        eq_(handler.get_emoji('anton'), ':sparkles:')
        eq_(handler.get_emoji('nguyen'), ':snowman:')
コード例 #2
0
 def test_get_emoji_returns_emoji_even_if_emoji_list_is_empty(self):
     event = TestableEvent()
     self.config.update({
         'HAPPY_SLACK_EMOJIS': []
     })
     handler = SlackHandler(event, self.config)
     eq_(handler.get_emoji('anton'), ':heart:')
コード例 #3
0
 def test_get_emoji_returns_same_emoji_for_author(self):
     event = TestableEvent()
     handler = SlackHandler(event, self.config)
     eq_(handler.get_emoji('anton'), ':sparkles:')
     eq_(handler.get_emoji('nguyen'), ':snowman:')