MCPcopy Index your code
hub / github.com/google/go-github / TestIssuesService_IsAssignee_error

Function TestIssuesService_IsAssignee_error

github/issues_assignees_test.go:127–158  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

125}
126
127func TestIssuesService_IsAssignee_error(t *testing.T) {
128 t.Parallel()
129 client, mux, _ := setup(t)
130
131 mux.HandleFunc("/repos/o/r/assignees/u", func(w http.ResponseWriter, r *http.Request) {
132 testMethod(t, r, "GET")
133 http.Error(w, "BadRequest", http.StatusBadRequest)
134 })
135
136 ctx := t.Context()
137 assignee, _, err := client.Issues.IsAssignee(ctx, "o", "r", "u")
138 if err == nil {
139 t.Error("Expected HTTP 400 response")
140 }
141 if want := false; assignee != want {
142 t.Errorf("Issues.IsAssignee returned %+v, want %+v", assignee, want)
143 }
144
145 const methodName = "IsAssignee"
146 testBadOptions(t, methodName, func() (err error) {
147 _, _, err = client.Issues.IsAssignee(ctx, "o", "r", "u")
148 return err
149 })
150
151 testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
152 got, resp, err := client.Issues.IsAssignee(ctx, "o", "r", "u")
153 if got {
154 t.Errorf("testNewRequestAndDoFailure %v = %#v, want false", methodName, got)
155 }
156 return resp, err
157 })
158}
159
160func TestIssuesService_IsAssignee_invalidOwner(t *testing.T) {
161 t.Parallel()

Callers

nothing calls this directly

Calls 6

testMethodFunction · 0.85
testBadOptionsFunction · 0.85
IsAssigneeMethod · 0.80
setupFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…