Add agentpr pr edit subcommand #15

Merged
benvin merged 3 commits from benvin/agentpr-pr-edit into main 2026-09-19 13:48:44 +10:00
Showing only changes of commit 3f990c841d - Show all commits
+2 -2
View File
@@ -156,7 +156,7 @@ func TestEditPRAPIError(t *testing.T) {
mux := http.NewServeMux()
mux.HandleFunc("/api/v1/repos/unkin/repo/pulls/7", func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusNotFound)
_, _ = io.WriteString(w, `{"message":"pull request does not exist"}`)
_, _ = io.WriteString(w, `{"message":"not found","url":"https://git.unkin.net/api/swagger","errors":null}`)
})
srv := httptest.NewServer(mux)
defer srv.Close()
@@ -167,7 +167,7 @@ func TestEditPRAPIError(t *testing.T) {
if err == nil {
t.Fatal("expected error on 404")
}
if !strings.Contains(err.Error(), "pull request does not exist") {
if !strings.Contains(err.Error(), `"message":"not found"`) {
t.Errorf("error %q should carry the API message", err)
}
}