feat: reuse single comment
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
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"}
|
||||
Reference in New Issue
Block a user