def test_should_handle_returns_false_if_repo_is_blacklisted(self):
     event = TestableEvent(repository='org_name/blacklisted')
     self.config.update({
         'REPO_BLACKLIST': ['org_name/blacklisted']
     })
     handler = SlackHandler(event, self.config)
     ok_(not handler.should_handle())
 def test_should_handle_returns_false_if_there_is_no_channel_to_notify(self):
     event = TestableEvent()
     self.config.update({
         'TEAMS': {}
     })
     handler = SlackHandler(event, self.config)
     ok_(not handler.should_handle())
 def test_should_handle_returns_true(self):
     event = TestableEvent()
     handler = SlackHandler(event, self.config)
     ok_(handler.should_handle())
 def test_should_handle_returns_false_if_there_is_no_pull_request_body(self):
     event = TestableEvent(pull_request=None)
     handler = SlackHandler(event, self.config)
     ok_(not handler.should_handle())
 def test_should_handle_returns_false_if_invalid_action(self):
     event = TestableEvent(action='edited')
     handler = SlackHandler(event, self.config)
     ok_(not handler.should_handle())