mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
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:
parent
a77d44e919
commit
a1f46611e1
10 changed files with 218 additions and 195 deletions
|
@ -6,6 +6,7 @@ from logging import DEBUG
|
|||
|
||||
import pytest
|
||||
|
||||
from fastapi import HTTPException
|
||||
from fastapi.testclient import TestClient
|
||||
|
||||
from aurweb import asgi, config, db
|
||||
|
@ -15,6 +16,7 @@ from aurweb.models.package_notification import PackageNotification
|
|||
from aurweb.models.package_request import ACCEPTED_ID, PENDING_ID, REJECTED_ID
|
||||
from aurweb.models.request_type import DELETION_ID, MERGE_ID, ORPHAN_ID
|
||||
from aurweb.packages.requests import ClosureFactory
|
||||
from aurweb.requests.util import get_pkgreq_by_id
|
||||
from aurweb.testing.email import Email
|
||||
from aurweb.testing.html import get_errors
|
||||
from aurweb.testing.requests import Request
|
||||
|
@ -583,3 +585,8 @@ def test_closure_factory_invalid_reqtype_id():
|
|||
automated.get_closure(666, None, None, None, ACCEPTED_ID)
|
||||
with pytest.raises(NotImplementedError, match=match):
|
||||
automated.get_closure(666, None, None, None, REJECTED_ID)
|
||||
|
||||
|
||||
def test_pkgreq_by_id_not_found():
|
||||
with pytest.raises(HTTPException):
|
||||
get_pkgreq_by_id(0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue