Add ability for triggers to be disabled
Will be used in the followup commit to automatically disable broken triggers
This commit is contained in:
parent
1e54a4d9e9
commit
c35eec0615
18 changed files with 358 additions and 37 deletions
24
endpoints/test/test_webhooks.py
Normal file
24
endpoints/test/test_webhooks.py
Normal file
|
@ -0,0 +1,24 @@
|
|||
import base64
|
||||
import pytest
|
||||
|
||||
from flask import url_for
|
||||
|
||||
from data import model
|
||||
from endpoints.test.shared import conduct_call
|
||||
from test.fixtures import *
|
||||
|
||||
def test_start_build_disabled_trigger(app, client):
|
||||
trigger = model.build.list_build_triggers('devtable', 'building')[0]
|
||||
trigger.enabled = False
|
||||
trigger.save()
|
||||
|
||||
params = {
|
||||
'trigger_uuid': trigger.uuid,
|
||||
}
|
||||
|
||||
headers = {
|
||||
'Authorization': 'Basic ' + base64.b64encode('devtable:password'),
|
||||
}
|
||||
|
||||
conduct_call(client, 'webhooks.build_trigger_webhook', url_for, 'POST', params, None, 400,
|
||||
headers=headers)
|
Reference in a new issue