Files
agentci/tests/test_gitea.py
T

23 lines
609 B
Python

import json
import httpx
import respx
from agentci.adapters.gitea import GiteaClient
@respx.mock
async def test_updates_issue_comment_by_id() -> None:
route = respx.patch(
"https://gitea.example/api/v1/repos/org/repo/issues/comments/17"
).mock(return_value=httpx.Response(200, json={"id": 17}))
client = GiteaClient("https://gitea.example", "secret")
try:
await client.update_comment("org", "repo", 17, "updated status")
finally:
await client.close()
assert route.called
assert json.loads(route.calls[0].request.content) == {"body": "updated status"}