feat(rpc): add GET /rpc/v5/search/{arg} openapi route

Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
Kevin Morris 2022-09-12 06:49:20 -07:00
parent 5e75a00c17
commit 8e8b746a5b
No known key found for this signature in database
GPG key ID: F7E46DED420788F3
2 changed files with 30 additions and 1 deletions

View file

@ -986,6 +986,18 @@ def test_rpc_openapi_multiinfo_post_bad_request(
assert data.get("error") == expected
def test_rpc_openapi_search_arg(client: TestClient, packages: list[Package]):
pkgname = packages[0].Name
with client as request:
endp = f"/rpc/v5/search/{pkgname}"
resp = request.get(endp)
assert resp.status_code == HTTPStatus.OK
data = resp.json()
assert data.get("resultcount") == 1
def test_rpc_openapi_search(client: TestClient, packages: list[Package]):
pkgname = packages[0].Name