change(python): move request & pkgbase request routes

Move package request routes and related routes to their
respective routers. In addition, move some utility used
for requests over from `aurweb.packages`.

Introduced routers:
- `aurweb.routers.requests`

Introduced package:
- `aurweb.requests`

Introduced module:
- `aurweb.requests.util`

Changes:
- Moved `aurweb.packages.validate` to `aurweb.pkgbase.validate`
- Moved requests listing & request closure routes to
  `aurweb.routers.requests`
- Moved pkgbase request creation route to `aurweb.routers.pkgbase`
- Moved `get_pkgreq_by_id` from `aurweb.packages.util` to
  `aurweb.requests.util` and fixed its return type hint.

Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
Kevin Morris 2022-01-02 00:54:56 -08:00
parent a77d44e919
commit a1f46611e1
No known key found for this signature in database
GPG key ID: F7E46DED420788F3
10 changed files with 218 additions and 195 deletions

View file

@ -2,7 +2,6 @@ from datetime import datetime
import pytest
from fastapi import HTTPException
from fastapi.testclient import TestClient
from aurweb import asgi, config, db
@ -98,11 +97,6 @@ def test_query_notified(maintainer: User, package: Package):
assert query_notified[package.PackageBase.ID]
def test_pkgreq_by_id_not_found():
with pytest.raises(HTTPException):
util.get_pkgreq_by_id(0)
def test_source_uri_file(package: Package):
FILE = "test_file"