Change to nicer API method names and add the internal_api_call decorator in prep for the automatic discovery mechanism
This commit is contained in:
parent
445145f9b9
commit
1904e6d0c8
2 changed files with 72 additions and 44 deletions
|
@ -105,20 +105,20 @@ def build_specs():
|
|||
return [
|
||||
TestSpec(url_for('welcome'), 200, 200, 200, 200),
|
||||
|
||||
TestSpec(url_for('plans_list'), 200, 200, 200, 200),
|
||||
TestSpec(url_for('list_plans'), 200, 200, 200, 200),
|
||||
|
||||
TestSpec(url_for('get_logged_in_user'), 200, 200, 200, 200),
|
||||
|
||||
TestSpec(url_for('change_user_details'),
|
||||
401, 200, 200, 200).set_method('PUT'),
|
||||
|
||||
TestSpec(url_for('create_user_api'), 201, 201, 201,
|
||||
TestSpec(url_for('create_new_user'), 201, 201, 201,
|
||||
201).set_method('POST').set_data_from_obj(NEW_USER_DETAILS),
|
||||
|
||||
TestSpec(url_for('signin_api'), 200, 200, 200,
|
||||
TestSpec(url_for('signin_user'), 200, 200, 200,
|
||||
200).set_method('POST').set_data_from_obj(SIGNIN_DETAILS),
|
||||
|
||||
TestSpec(url_for('send_recovery'), 201, 201, 201,
|
||||
TestSpec(url_for('request_recovery_email'), 201, 201, 201,
|
||||
201).set_method('POST').set_data_from_obj(SEND_RECOVERY_DETAILS),
|
||||
|
||||
TestSpec(url_for('get_matching_users', prefix='dev'), 401, 200, 200, 200),
|
||||
|
@ -161,29 +161,29 @@ def build_specs():
|
|||
teamname=ORG_READERS, membername=ORG_OWNER),
|
||||
admin_code=400).set_method('DELETE'),
|
||||
|
||||
(TestSpec(url_for('create_repo_api'))
|
||||
(TestSpec(url_for('create_repo'))
|
||||
.set_method('POST')
|
||||
.set_data_from_obj(NEW_ORG_REPO_DETAILS)),
|
||||
|
||||
TestSpec(url_for('match_repos_api'), 200, 200, 200, 200),
|
||||
TestSpec(url_for('find_repos'), 200, 200, 200, 200),
|
||||
|
||||
TestSpec(url_for('list_repos_api'), 200, 200, 200, 200),
|
||||
TestSpec(url_for('list_repos'), 200, 200, 200, 200),
|
||||
|
||||
TestSpec(url_for('update_repo_api', repository=PUBLIC_REPO),
|
||||
TestSpec(url_for('update_repo', repository=PUBLIC_REPO),
|
||||
admin_code=403).set_method('PUT'),
|
||||
(TestSpec(url_for('update_repo_api', repository=ORG_REPO))
|
||||
(TestSpec(url_for('update_repo', repository=ORG_REPO))
|
||||
.set_method('PUT')
|
||||
.set_data_from_obj(UPDATE_REPO_DETAILS)),
|
||||
(TestSpec(url_for('update_repo_api', repository=PRIVATE_REPO))
|
||||
(TestSpec(url_for('update_repo', repository=PRIVATE_REPO))
|
||||
.set_method('PUT')
|
||||
.set_data_from_obj(UPDATE_REPO_DETAILS)),
|
||||
|
||||
(TestSpec(url_for('change_repo_visibility_api', repository=PUBLIC_REPO),
|
||||
(TestSpec(url_for('change_repo_visibility', repository=PUBLIC_REPO),
|
||||
admin_code=403).set_method('POST')
|
||||
.set_data_from_obj(CHANGE_VISIBILITY_DETAILS)),
|
||||
(TestSpec(url_for('change_repo_visibility_api', repository=ORG_REPO))
|
||||
(TestSpec(url_for('change_repo_visibility', repository=ORG_REPO))
|
||||
.set_method('POST').set_data_from_obj(CHANGE_VISIBILITY_DETAILS)),
|
||||
(TestSpec(url_for('change_repo_visibility_api', repository=PRIVATE_REPO))
|
||||
(TestSpec(url_for('change_repo_visibility', repository=PRIVATE_REPO))
|
||||
.set_method('POST').set_data_from_obj(CHANGE_VISIBILITY_DETAILS)),
|
||||
|
||||
TestSpec(url_for('delete_repository', repository=PUBLIC_REPO),
|
||||
|
@ -193,11 +193,11 @@ def build_specs():
|
|||
TestSpec(url_for('delete_repository', repository=PRIVATE_REPO),
|
||||
admin_code=204).set_method('DELETE'),
|
||||
|
||||
TestSpec(url_for('get_repo_api', repository=PUBLIC_REPO),
|
||||
TestSpec(url_for('get_repo', repository=PUBLIC_REPO),
|
||||
200, 200, 200,200),
|
||||
TestSpec(url_for('get_repo_api', repository=ORG_REPO),
|
||||
TestSpec(url_for('get_repo', repository=ORG_REPO),
|
||||
403, 403, 200, 200),
|
||||
TestSpec(url_for('get_repo_api', repository=PRIVATE_REPO),
|
||||
TestSpec(url_for('get_repo', repository=PRIVATE_REPO),
|
||||
403, 403, 200, 200),
|
||||
|
||||
TestSpec(url_for('get_repo_builds', repository=PUBLIC_REPO),
|
||||
|
@ -403,20 +403,20 @@ def build_specs():
|
|||
TestSpec(url_for('delete_token', repository=PRIVATE_REPO,
|
||||
code=FAKE_TOKEN), admin_code=400).set_method('DELETE'),
|
||||
|
||||
TestSpec(url_for('subscribe_api'), 401, 400, 400, 400).set_method('PUT'),
|
||||
TestSpec(url_for('update_user_subscription'), 401, 400, 400, 400).set_method('PUT'),
|
||||
|
||||
TestSpec(url_for('subscribe_org_api', orgname=ORG),
|
||||
TestSpec(url_for('update_org_subscription', orgname=ORG),
|
||||
401, 403, 403, 400).set_method('PUT'),
|
||||
|
||||
TestSpec(url_for('get_subscription'), 401, 200, 200, 200),
|
||||
|
||||
TestSpec(url_for('get_org_subscription', orgname=ORG)),
|
||||
|
||||
TestSpec(url_for('repo_logs_api', repository=PUBLIC_REPO), admin_code=403),
|
||||
TestSpec(url_for('repo_logs_api', repository=ORG_REPO)),
|
||||
TestSpec(url_for('repo_logs_api', repository=PRIVATE_REPO)),
|
||||
TestSpec(url_for('list_repo_logs', repository=PUBLIC_REPO), admin_code=403),
|
||||
TestSpec(url_for('list_repo_logs', repository=ORG_REPO)),
|
||||
TestSpec(url_for('list_repo_logs', repository=PRIVATE_REPO)),
|
||||
|
||||
TestSpec(url_for('org_logs_api', orgname=ORG)),
|
||||
TestSpec(url_for('list_org_logs', orgname=ORG)),
|
||||
]
|
||||
|
||||
|
||||
|
|
Reference in a new issue