test: cover Filed withdrawal authorization
All checks were successful
CI / lint (pull_request) Successful in 1m55s
CI / build-release (pull_request) Successful in 5s
CI / browser-journey (pull_request) Successful in 55s
CI / release-candidate (pull_request) Has been skipped

This commit is contained in:
timmy 2026-08-15 10:04:10 +00:00
parent 6a03dfd7ac
commit e64541463c

View File

@ -202,6 +202,33 @@ async def test_completed_filed_issue_remains_authorized_for_detail_and_reply():
assert authorized is True
@pytest.mark.anyio
@pytest.mark.parametrize(
("state", "author", "authorized"),
[("open", "timmy", True), ("closed", "timmy", False), ("open", "alex", False)],
)
async def test_only_open_authored_issues_are_authorized_for_withdrawal(
state, author, authorized
):
async def upstream(request):
if request.url.path.endswith("/user"):
return httpx.Response(200, json={"login": "timmy"})
return httpx.Response(200, json={
"state": state,
"user": {"login": author},
})
gitea_proxy.start_client(transport=httpx.MockTransport(upstream))
try:
result = await gitea_proxy.is_open_authored_issue(
"stackchain/dashboard", 89
)
finally:
await gitea_proxy.stop_client()
assert result is authorized
@pytest.mark.anyio
async def test_resolve_work_route_rejects_a_notification_that_is_already_read():
async def upstream(request):