コード例 #1
0
 def test_parse_teams_returns_a_list_of_two_if_author_found_in_multiple_teams(self):
     event = TestableEvent()
     handler = SlackHandler(event, self.config)
     teams = {
         'rocket': {
             'jesse': {
                 'slack': 'jesse'
             },
             'james': {
                 'slack': 'james'
             },
             'meowth': {
                 'slack': 'meowth'
             }
         },
         'team-catchem': {
             'ash': {
                 'slack': 'ash'
             },
             'meowth': {
                 'slack': 'meowth'
             }
         }
     }
     channels_to_notify = handler.parse_teams(teams, 'meowth')
     eq_(channels_to_notify, [
         {'name': 'rocket', 'slack': 'meowth'},
         {'name': 'team-catchem', 'slack': 'meowth'},
     ])
コード例 #2
0
 def test_parse_teams_returns_a_non_empty_list_if_author_found(self):
     event = TestableEvent()
     handler = SlackHandler(event, self.config)
     teams = {
         'rocket': {
             'jesse': {
                 'slack': 'jesse'
             },
             'james': {
                 'slack': 'james'
             },
             'meowth': {
                 'slack': 'mewoth'
             }
         }
     }
     channels_to_notify = handler.parse_teams(teams, 'jesse')
     eq_(channels_to_notify, [{'name': 'rocket', 'slack': 'jesse'}])
コード例 #3
0
 def test_parse_teams_returns_empty_list_if_no_teams_provided(self):
     event = TestableEvent()
     handler = SlackHandler(event, self.config)
     teams = {}
     channels_to_notify = handler.parse_teams(teams, 'anton')
     eq_(channels_to_notify, [])