Add tests for build web hooks endpoint

This commit is contained in:
Joseph Schorr 2017-03-20 13:22:59 -04:00
parent 0ea600628b
commit 6f567e0850
7 changed files with 64 additions and 12 deletions

View file

@ -514,7 +514,7 @@ class GitLabBuildTrigger(BuildTriggerHandler):
def handle_trigger_request(self, request):
payload = request.get_json()
if not payload:
raise SkipRequestException()
raise InvalidPayloadException()
logger.debug('GitLab trigger payload %s', payload)
@ -523,7 +523,7 @@ class GitLabBuildTrigger(BuildTriggerHandler):
repo = gl_client.getproject(self.config['build_source'])
if repo is False:
logger.debug('Skipping GitLab build; project %s not found', self.config['build_source'])
raise SkipRequestException()
raise InvalidPayloadException()
default_branch = repo['default_branch']
metadata = get_transformed_webhook_payload(payload, default_branch=default_branch,