MCPcopy Index your code
hub / github.com/github/github-mcp-server / Test_IsAcceptedError

Function Test_IsAcceptedError

pkg/github/params_test.go:12–46  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

10)
11
12func Test_IsAcceptedError(t *testing.T) {
13 tests := []struct {
14 name string
15 err error
16 expectAccepted bool
17 }{
18 {
19 name: "github AcceptedError",
20 err: &github.AcceptedError{},
21 expectAccepted: true,
22 },
23 {
24 name: "regular error",
25 err: fmt.Errorf("some other error"),
26 expectAccepted: false,
27 },
28 {
29 name: "nil error",
30 err: nil,
31 expectAccepted: false,
32 },
33 {
34 name: "wrapped AcceptedError",
35 err: fmt.Errorf("wrapped: %w", &github.AcceptedError{}),
36 expectAccepted: true,
37 },
38 }
39
40 for _, tc := range tests {
41 t.Run(tc.name, func(t *testing.T) {
42 result := isAcceptedError(tc.err)
43 assert.Equal(t, tc.expectAccepted, result)
44 })
45 }
46}
47
48func Test_RequiredStringParam(t *testing.T) {
49 tests := []struct {

Callers

nothing calls this directly

Calls 1

isAcceptedErrorFunction · 0.85

Tested by

no test coverage detected