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

Function TestGranularUpdateIssueBody

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

Source from the content-addressed store, hash-verified

227}
228
229func TestGranularUpdateIssueBody(t *testing.T) {
230 client := mustNewGHClient(t, MockHTTPClientWithHandlers(map[string]http.HandlerFunc{
231 PatchReposIssuesByOwnerByRepoByIssueNumber: expectRequestBody(t, map[string]any{
232 "body": "Updated body",
233 }).andThen(mockResponse(t, http.StatusOK, &gogithub.Issue{
234 Number: gogithub.Ptr(1),
235 Body: gogithub.Ptr("Updated body"),
236 })),
237 }))
238 deps := BaseDeps{Client: client}
239 serverTool := GranularUpdateIssueBody(translations.NullTranslationHelper)
240 handler := serverTool.Handler(deps)
241
242 request := createMCPRequest(map[string]any{
243 "owner": "owner",
244 "repo": "repo",
245 "issue_number": float64(1),
246 "body": "Updated body",
247 })
248 result, err := handler(ContextWithDeps(context.Background(), deps), &request)
249 require.NoError(t, err)
250 assert.False(t, result.IsError)
251}
252
253func TestGranularUpdateIssueAssignees(t *testing.T) {
254 client := mustNewGHClient(t, MockHTTPClientWithHandlers(map[string]http.HandlerFunc{

Callers

nothing calls this directly

Calls 9

mustNewGHClientFunction · 0.85
expectRequestBodyFunction · 0.85
mockResponseFunction · 0.85
GranularUpdateIssueBodyFunction · 0.85
createMCPRequestFunction · 0.85
ContextWithDepsFunction · 0.85
andThenMethod · 0.80
HandlerMethod · 0.45

Tested by

no test coverage detected