mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
feat(FastAPI): add /pkgbase/{name}/voters (get)
Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
836af2d588
commit
fbd91f346a
3 changed files with 54 additions and 0 deletions
|
@ -912,3 +912,21 @@ def test_packages_per_page(client: TestClient, maintainer: User):
|
|||
root = parse_root(response.text)
|
||||
rows = root.xpath('//table[@class="results"]/tbody/tr')
|
||||
assert len(rows) == 250
|
||||
|
||||
|
||||
def test_pkgbase_voters(client: TestClient, maintainer: User, package: Package):
|
||||
pkgbase = package.PackageBase
|
||||
endpoint = f"/pkgbase/{pkgbase.Name}/voters"
|
||||
|
||||
now = int(datetime.utcnow().timestamp())
|
||||
with db.begin():
|
||||
db.create(PackageVote, User=maintainer, PackageBase=pkgbase,
|
||||
VoteTS=now)
|
||||
|
||||
with client as request:
|
||||
resp = request.get(endpoint)
|
||||
assert resp.status_code == int(HTTPStatus.OK)
|
||||
|
||||
root = parse_root(resp.text)
|
||||
rows = root.xpath('//div[@class="box"]//ul/li')
|
||||
assert len(rows) == 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue