MCPcopy
hub / github.com/github/github-mcp-server / TestGranularUpdateIssueTitle

Function TestGranularUpdateIssueTitle

pkg/github/granular_tools_test.go:207–227  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

205}
206
207func TestGranularUpdateIssueTitle(t *testing.T) {
208 client := mustNewGHClient(t, MockHTTPClientWithHandlers(map[string]http.HandlerFunc{
209 PatchReposIssuesByOwnerByRepoByIssueNumber: mockResponse(t, http.StatusOK, &gogithub.Issue{
210 Number: gogithub.Ptr(42),
211 Title: gogithub.Ptr("New Title"),
212 }),
213 }))
214 deps := BaseDeps{Client: client}
215 serverTool := GranularUpdateIssueTitle(translations.NullTranslationHelper)
216 handler := serverTool.Handler(deps)
217
218 request := createMCPRequest(map[string]any{
219 "owner": "owner",
220 "repo": "repo",
221 "issue_number": float64(42),
222 "title": "New Title",
223 })
224 result, err := handler(ContextWithDeps(context.Background(), deps), &request)
225 require.NoError(t, err)
226 assert.False(t, result.IsError)
227}
228
229func TestGranularUpdateIssueBody(t *testing.T) {
230 client := mustNewGHClient(t, MockHTTPClientWithHandlers(map[string]http.HandlerFunc{

Callers

nothing calls this directly

Calls 7

mustNewGHClientFunction · 0.85
mockResponseFunction · 0.85
GranularUpdateIssueTitleFunction · 0.85
createMCPRequestFunction · 0.85
ContextWithDepsFunction · 0.85
HandlerMethod · 0.45

Tested by

no test coverage detected