mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
feat(rpc): support POST method
Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
26f0b014f9
commit
2dfa41c9a5
3 changed files with 75 additions and 16 deletions
|
@ -782,3 +782,16 @@ def test_rpc_jsonp_callback(client: TestClient):
|
|||
response = request.get("/rpc", params=params)
|
||||
assert response.headers.get("content-type") == "application/json"
|
||||
assert response.json().get("error") == "Invalid callback name."
|
||||
|
||||
|
||||
def test_rpc_post(client: TestClient, packages: List[Package]):
|
||||
data = {
|
||||
"v": 5,
|
||||
"type": "info",
|
||||
"arg": "big-chungus",
|
||||
"arg[]": ["chungy-chungus"]
|
||||
}
|
||||
with client as request:
|
||||
resp = request.post("/rpc", data=data)
|
||||
assert resp.status_code == int(HTTPStatus.OK)
|
||||
assert resp.json().get("resultcount") == 2
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue