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

Function TestProjectsService_ListUserProjects_error

github/projects_test.go:433–454  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

431}
432
433func TestProjectsService_ListUserProjects_error(t *testing.T) {
434 t.Parallel()
435 client, mux, _ := setup(t)
436 mux.HandleFunc("/users/u/projectsV2", func(w http.ResponseWriter, r *http.Request) {
437 testMethod(t, r, "GET")
438 fmt.Fprint(w, `[]`)
439 })
440 ctx := t.Context()
441 const methodName = "ListUserProjects"
442 testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
443 got, resp, err := client.Projects.ListUserProjects(ctx, "u", nil)
444 if got != nil {
445 t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got)
446 }
447 return resp, err
448 })
449 // bad options (bad username) should error
450 testBadOptions(t, methodName, func() (err error) {
451 _, _, err = client.Projects.ListUserProjects(ctx, "\n", nil)
452 return err
453 })
454}
455
456func TestProjectsService_ListOrganizationProjectFields_pagination(t *testing.T) {
457 t.Parallel()

Callers

nothing calls this directly

Calls 5

testMethodFunction · 0.85
testBadOptionsFunction · 0.85
ListUserProjectsMethod · 0.80
setupFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…