-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #74 from samuzzal-choudhury/user_repo_api
Added dummy user-repo endpoints with swagger spec
- Loading branch information
Showing
3 changed files
with
224 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,22 @@ | |
"git-sha": "sha" | ||
} | ||
|
||
payload_user_repo_scan_drop = { | ||
"git-url": "test", | ||
"email-ids": ["[email protected]"] | ||
} | ||
|
||
|
||
payload_user_repo_notify = { | ||
"epv_list": [ | ||
{ | ||
"ecosystem": "maven", | ||
"name": "io.vertx:vertx-core", | ||
"version": "3.5.2" | ||
} | ||
] | ||
} | ||
|
||
|
||
def api_route_for(route): | ||
"""Construct an URL to the endpoint for given route.""" | ||
|
@@ -162,3 +178,27 @@ def test_register_endpoint_6(get_info, client): | |
data=json.dumps(payload), | ||
content_type='application/json') | ||
assert reg_resp.status_code == 500 | ||
|
||
|
||
def test_scan_endpoint(client): | ||
"""Test the /api/v1/user-repo/scan endpoint.""" | ||
reg_resp = client.post(api_route_for('user-repo/scan'), | ||
data=json.dumps(payload_user_repo_scan_drop), | ||
content_type='application/json') | ||
assert reg_resp.status_code == 200 | ||
|
||
|
||
def test_drop_endpoint(client): | ||
"""Test the /api/v1/user-repo/drop endpoint.""" | ||
reg_resp = client.post(api_route_for('user-repo/scan'), | ||
data=json.dumps(payload_user_repo_scan_drop), | ||
content_type='application/json') | ||
assert reg_resp.status_code == 200 | ||
|
||
|
||
def test_notify_endpoint(client): | ||
"""Test the /api/v1/user-repo/notify endpoint.""" | ||
reg_resp = client.post(api_route_for('user-repo/scan'), | ||
data=json.dumps(payload_user_repo_notify), | ||
content_type='application/json') | ||
assert reg_resp.status_code == 200 |