Merge pull request #349 from coreos-inc/buildreffix
Really fix the build trigger schema and add a test for it
This commit is contained in:
commit
aee746bec6
2 changed files with 4 additions and 8 deletions
|
@ -402,12 +402,8 @@ class ActivateBuildTrigger(RepositoryParamResource):
|
||||||
'description': '(Custom Only) If specified, the ref/SHA1 used to checkout a git repository.'
|
'description': '(Custom Only) If specified, the ref/SHA1 used to checkout a git repository.'
|
||||||
},
|
},
|
||||||
'refs': {
|
'refs': {
|
||||||
'type': 'array',
|
'type': 'object',
|
||||||
'description': '(SCM Only) If specified, the refs to build.'
|
'description': '(SCM Only) If specified, the ref to build.'
|
||||||
},
|
|
||||||
'branch_name': {
|
|
||||||
'type': 'string',
|
|
||||||
'description': '(SCM Only) If specified, the branch to build.'
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'additionalProperties': False
|
'additionalProperties': False
|
||||||
|
|
|
@ -2993,7 +2993,7 @@ class TestBuildTriggers(ApiTestCase):
|
||||||
start_json = self.postJsonResponse(ActivateBuildTrigger,
|
start_json = self.postJsonResponse(ActivateBuildTrigger,
|
||||||
params=dict(repository=ADMIN_ACCESS_USER + '/simple',
|
params=dict(repository=ADMIN_ACCESS_USER + '/simple',
|
||||||
trigger_uuid=trigger.uuid),
|
trigger_uuid=trigger.uuid),
|
||||||
data=dict(refs=[{'kind': 'branch', 'name': 'foobar'}]),
|
data=dict(refs={'kind': 'branch', 'name': 'foobar'}),
|
||||||
expected_code=201)
|
expected_code=201)
|
||||||
|
|
||||||
def test_invalid_robot_account(self):
|
def test_invalid_robot_account(self):
|
||||||
|
@ -3058,7 +3058,7 @@ class TestBuildTriggers(ApiTestCase):
|
||||||
start_json = self.postJsonResponse(ActivateBuildTrigger,
|
start_json = self.postJsonResponse(ActivateBuildTrigger,
|
||||||
params=dict(repository=ADMIN_ACCESS_USER + '/simple',
|
params=dict(repository=ADMIN_ACCESS_USER + '/simple',
|
||||||
trigger_uuid=trigger.uuid),
|
trigger_uuid=trigger.uuid),
|
||||||
data=dict(),
|
data=dict(refs=dict(kind='branch', name='foobar')),
|
||||||
expected_code=201)
|
expected_code=201)
|
||||||
|
|
||||||
assert 'id' in start_json
|
assert 'id' in start_json
|
||||||
|
|
Reference in a new issue