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

Function TestProjectsService_GetOrganizationProject

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

Source from the content-addressed store, hash-verified

63}
64
65func TestProjectsService_GetOrganizationProject(t *testing.T) {
66 t.Parallel()
67 client, mux, _ := setup(t)
68
69 mux.HandleFunc("/orgs/o/projectsV2/1", func(w http.ResponseWriter, r *http.Request) {
70 testMethod(t, r, "GET")
71 fmt.Fprint(w, `{"id":1,"title":"OrgProj","created_at":"2011-01-02T15:04:05Z","updated_at":"2012-01-02T15:04:05Z"}`)
72 })
73
74 ctx := t.Context()
75 project, _, err := client.Projects.GetOrganizationProject(ctx, "o", 1)
76 if err != nil {
77 t.Fatalf("Projects.GetOrganizationProject returned error: %v", err)
78 }
79 if project.GetID() != 1 || project.GetTitle() != "OrgProj" {
80 t.Fatalf("Projects.GetOrganizationProject returned %+v", project)
81 }
82
83 const methodName = "GetOrganizationProject"
84 testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
85 got, resp, err := client.Projects.GetOrganizationProject(ctx, "o", 1)
86 if got != nil {
87 t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got)
88 }
89 return resp, err
90 })
91}
92
93func TestProjectsService_ListUserProjects(t *testing.T) {
94 t.Parallel()

Callers

nothing calls this directly

Calls 6

testMethodFunction · 0.85
setupFunction · 0.70
GetIDMethod · 0.45
GetTitleMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…