From 7b9a88ea9bef6c57c1898befe071d512edf19508 Mon Sep 17 00:00:00 2001 From: vikkyomkar Date: Mon, 24 Aug 2020 23:41:05 +0530 Subject: [PATCH] Remove graduated GitHub v3 API preview headers --- github/apps.go | 18 ------------------ github/apps_installation.go | 8 -------- github/apps_installation_test.go | 4 ---- github/apps_test.go | 12 ------------ github/github.go | 6 ------ github/issues.go | 20 ++++++-------------- github/issues_events.go | 4 +--- github/issues_events_test.go | 4 +--- github/issues_test.go | 17 +++++------------ github/orgs.go | 3 --- github/orgs_test.go | 2 -- github/pulls.go | 16 +--------------- github/pulls_test.go | 9 +-------- 13 files changed, 15 insertions(+), 108 deletions(-) diff --git a/github/apps.go b/github/apps.go index c50bb0daaef..df52a3f86f9 100644 --- a/github/apps.go +++ b/github/apps.go @@ -145,9 +145,6 @@ func (s *AppsService) Get(ctx context.Context, appSlug string) (*App, *Response, return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeIntegrationPreview) - app := new(App) resp, err := s.client.Do(ctx, req, app) if err != nil { @@ -171,9 +168,6 @@ func (s *AppsService) ListInstallations(ctx context.Context, opts *ListOptions) return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeIntegrationPreview) - var i []*Installation resp, err := s.client.Do(ctx, req, &i) if err != nil { @@ -204,9 +198,6 @@ func (s *AppsService) ListUserInstallations(ctx context.Context, opts *ListOptio return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeIntegrationPreview) - var i struct { Installations []*Installation `json:"installations"` } @@ -257,9 +248,6 @@ func (s *AppsService) DeleteInstallation(ctx context.Context, id int64) (*Respon return nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeIntegrationPreview) - return s.client.Do(ctx, req, nil) } @@ -274,9 +262,6 @@ func (s *AppsService) CreateInstallationToken(ctx context.Context, id int64, opt return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeIntegrationPreview) - t := new(InstallationToken) resp, err := s.client.Do(ctx, req, t) if err != nil { @@ -343,9 +328,6 @@ func (s *AppsService) getInstallation(ctx context.Context, url string) (*Install return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeIntegrationPreview) - i := new(Installation) resp, err := s.client.Do(ctx, req, i) if err != nil { diff --git a/github/apps_installation.go b/github/apps_installation.go index b6864e0381b..cdc88ce3cb9 100644 --- a/github/apps_installation.go +++ b/github/apps_installation.go @@ -24,9 +24,6 @@ func (s *AppsService) ListRepos(ctx context.Context, opts *ListOptions) ([]*Repo return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeIntegrationPreview) - var r struct { Repositories []*Repository `json:"repositories"` } @@ -54,9 +51,6 @@ func (s *AppsService) ListUserRepos(ctx context.Context, id int64, opts *ListOpt return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeIntegrationPreview) - var r struct { Repositories []*Repository `json:"repositories"` } @@ -77,7 +71,6 @@ func (s *AppsService) AddRepository(ctx context.Context, instID, repoID int64) ( if err != nil { return nil, nil, err } - req.Header.Set("Accept", mediaTypeIntegrationPreview) r := new(Repository) resp, err := s.client.Do(ctx, req, r) @@ -97,7 +90,6 @@ func (s *AppsService) RemoveRepository(ctx context.Context, instID, repoID int64 if err != nil { return nil, err } - req.Header.Set("Accept", mediaTypeIntegrationPreview) return s.client.Do(ctx, req, nil) } diff --git a/github/apps_installation_test.go b/github/apps_installation_test.go index 03a381d74b1..50b7042cacb 100644 --- a/github/apps_installation_test.go +++ b/github/apps_installation_test.go @@ -19,7 +19,6 @@ func TestAppsService_ListRepos(t *testing.T) { mux.HandleFunc("/installation/repositories", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testHeader(t, r, "Accept", mediaTypeIntegrationPreview) testFormValues(t, r, values{ "page": "1", "per_page": "2", @@ -45,7 +44,6 @@ func TestAppsService_ListUserRepos(t *testing.T) { mux.HandleFunc("/user/installations/1/repositories", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testHeader(t, r, "Accept", mediaTypeIntegrationPreview) testFormValues(t, r, values{ "page": "1", "per_page": "2", @@ -71,7 +69,6 @@ func TestAppsService_AddRepository(t *testing.T) { mux.HandleFunc("/user/installations/1/repositories/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") - testHeader(t, r, "Accept", mediaTypeIntegrationPreview) fmt.Fprint(w, `{"id":1,"name":"n","description":"d","owner":{"login":"l"},"license":{"key":"mit"}}`) }) @@ -92,7 +89,6 @@ func TestAppsService_RemoveRepository(t *testing.T) { mux.HandleFunc("/user/installations/1/repositories/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") - testHeader(t, r, "Accept", mediaTypeIntegrationPreview) w.WriteHeader(http.StatusNoContent) }) diff --git a/github/apps_test.go b/github/apps_test.go index 6610482f55f..0740caa02c0 100644 --- a/github/apps_test.go +++ b/github/apps_test.go @@ -24,7 +24,6 @@ func TestAppsService_Get_authenticatedApp(t *testing.T) { mux.HandleFunc("/app", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testHeader(t, r, "Accept", mediaTypeIntegrationPreview) fmt.Fprint(w, `{"id":1}`) }) @@ -45,7 +44,6 @@ func TestAppsService_Get_specifiedApp(t *testing.T) { mux.HandleFunc("/apps/a", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testHeader(t, r, "Accept", mediaTypeIntegrationPreview) fmt.Fprint(w, `{"html_url":"https://github.com/apps/a"}`) }) @@ -66,7 +64,6 @@ func TestAppsService_ListInstallations(t *testing.T) { mux.HandleFunc("/app/installations", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testHeader(t, r, "Accept", mediaTypeIntegrationPreview) testFormValues(t, r, values{ "page": "1", "per_page": "2", @@ -167,7 +164,6 @@ func TestAppsService_GetInstallation(t *testing.T) { mux.HandleFunc("/app/installations/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testHeader(t, r, "Accept", mediaTypeIntegrationPreview) fmt.Fprint(w, `{"id":1, "app_id":1, "target_id":1, "target_type": "Organization"}`) }) @@ -188,7 +184,6 @@ func TestAppsService_ListUserInstallations(t *testing.T) { mux.HandleFunc("/user/installations", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testHeader(t, r, "Accept", mediaTypeIntegrationPreview) testFormValues(t, r, values{ "page": "1", "per_page": "2", @@ -245,7 +240,6 @@ func TestAppsService_DeleteInstallation(t *testing.T) { mux.HandleFunc("/app/installations/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "DELETE") w.WriteHeader(http.StatusNoContent) - testHeader(t, r, "Accept", mediaTypeIntegrationPreview) }) _, err := client.Apps.DeleteInstallation(context.Background(), 1) @@ -260,7 +254,6 @@ func TestAppsService_CreateInstallationToken(t *testing.T) { mux.HandleFunc("/app/installations/1/access_tokens", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "POST") - testHeader(t, r, "Accept", mediaTypeIntegrationPreview) fmt.Fprint(w, `{"token":"t"}`) }) @@ -307,7 +300,6 @@ func TestAppsService_CreateInstallationTokenWithOptions(t *testing.T) { } testMethod(t, r, "POST") - testHeader(t, r, "Accept", mediaTypeIntegrationPreview) fmt.Fprint(w, `{"token":"t"}`) }) @@ -351,7 +343,6 @@ func TestAppsService_FindOrganizationInstallation(t *testing.T) { mux.HandleFunc("/orgs/o/installation", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testHeader(t, r, "Accept", mediaTypeIntegrationPreview) fmt.Fprint(w, `{"id":1, "app_id":1, "target_id":1, "target_type": "Organization"}`) }) @@ -372,7 +363,6 @@ func TestAppsService_FindRepositoryInstallation(t *testing.T) { mux.HandleFunc("/repos/o/r/installation", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testHeader(t, r, "Accept", mediaTypeIntegrationPreview) fmt.Fprint(w, `{"id":1, "app_id":1, "target_id":1, "target_type": "Organization"}`) }) @@ -393,7 +383,6 @@ func TestAppsService_FindRepositoryInstallationByID(t *testing.T) { mux.HandleFunc("/repositories/1/installation", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testHeader(t, r, "Accept", mediaTypeIntegrationPreview) fmt.Fprint(w, `{"id":1, "app_id":1, "target_id":1, "target_type": "Organization"}`) }) @@ -414,7 +403,6 @@ func TestAppsService_FindUserInstallation(t *testing.T) { mux.HandleFunc("/users/u/installation", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testHeader(t, r, "Accept", mediaTypeIntegrationPreview) fmt.Fprint(w, `{"id":1, "app_id":1, "target_id":1, "target_type": "User"}`) }) diff --git a/github/github.go b/github/github.go index c739de925f3..b2b9af3d895 100644 --- a/github/github.go +++ b/github/github.go @@ -68,9 +68,6 @@ const ( // https://developer.github.com/changes/2016-09-14-projects-api/ mediaTypeProjectsPreview = "application/vnd.github.inertia-preview+json" - // https://developer.github.com/changes/2016-09-14-Integrations-Early-Access/ - mediaTypeIntegrationPreview = "application/vnd.github.machine-man-preview+json" - // https://developer.github.com/changes/2017-01-05-commit-search-api/ mediaTypeCommitSearchPreview = "application/vnd.github.cloak-preview+json" @@ -89,9 +86,6 @@ const ( // https://developer.github.com/changes/2018-03-16-protected-branches-required-approving-reviews/ mediaTypeRequiredApprovingReviewsPreview = "application/vnd.github.luke-cage-preview+json" - // https://developer.github.com/changes/2018-01-10-lock-reason-api-preview/ - mediaTypeLockReasonPreview = "application/vnd.github.sailor-v-preview+json" - // https://developer.github.com/changes/2018-05-07-new-checks-api-public-beta/ mediaTypeCheckRunsPreview = "application/vnd.github.antiope-preview+json" diff --git a/github/issues.go b/github/issues.go index ccce80abc79..b0e27981ddf 100644 --- a/github/issues.go +++ b/github/issues.go @@ -8,7 +8,6 @@ package github import ( "context" "fmt" - "strings" "time" ) @@ -161,9 +160,8 @@ func (s *IssuesService) listIssues(ctx context.Context, u string, opts *IssueLis return nil, nil, err } - // TODO: remove custom Accept headers when APIs fully launch. - acceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeLockReasonPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + // TODO: remove custom Accept header when this API fully launch. + req.Header.Set("Accept", mediaTypeReactionsPreview) var issues []*Issue resp, err := s.client.Do(ctx, req, &issues) @@ -229,9 +227,8 @@ func (s *IssuesService) ListByRepo(ctx context.Context, owner string, repo strin return nil, nil, err } - // TODO: remove custom Accept headers when APIs fully launch. - acceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeIntegrationPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + // TODO: remove custom Accept header when this API fully launches. + req.Header.Set("Accept", mediaTypeReactionsPreview) var issues []*Issue resp, err := s.client.Do(ctx, req, &issues) @@ -252,9 +249,8 @@ func (s *IssuesService) Get(ctx context.Context, owner string, repo string, numb return nil, nil, err } - // TODO: remove custom Accept headers when APIs fully launch. - acceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeLockReasonPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + // TODO: remove custom Accept header when this API fully launch. + req.Header.Set("Accept", mediaTypeReactionsPreview) issue := new(Issue) resp, err := s.client.Do(ctx, req, issue) @@ -322,10 +318,6 @@ func (s *IssuesService) Lock(ctx context.Context, owner string, repo string, num return nil, err } - if opts != nil { - req.Header.Set("Accept", mediaTypeLockReasonPreview) - } - return s.client.Do(ctx, req, nil) } diff --git a/github/issues_events.go b/github/issues_events.go index 8d3dd864cd1..f157d277a10 100644 --- a/github/issues_events.go +++ b/github/issues_events.go @@ -8,7 +8,6 @@ package github import ( "context" "fmt" - "strings" "time" ) @@ -108,8 +107,7 @@ func (s *IssuesService) ListIssueEvents(ctx context.Context, owner, repo string, return nil, nil, err } - acceptHeaders := []string{mediaTypeLockReasonPreview, mediaTypeProjectCardDetailsPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeProjectCardDetailsPreview) var events []*IssueEvent resp, err := s.client.Do(ctx, req, &events) diff --git a/github/issues_events_test.go b/github/issues_events_test.go index 17d6ac3d52f..4417c25f342 100644 --- a/github/issues_events_test.go +++ b/github/issues_events_test.go @@ -10,7 +10,6 @@ import ( "fmt" "net/http" "reflect" - "strings" "testing" ) @@ -18,10 +17,9 @@ func TestIssuesService_ListIssueEvents(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - wantAcceptHeaders := []string{mediaTypeLockReasonPreview, mediaTypeProjectCardDetailsPreview} mux.HandleFunc("/repos/o/r/issues/1/events", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testHeader(t, r, "Accept", strings.Join(wantAcceptHeaders, ", ")) + testHeader(t, r, "Accept", mediaTypeProjectCardDetailsPreview) testFormValues(t, r, values{ "page": "1", "per_page": "2", diff --git a/github/issues_test.go b/github/issues_test.go index 6792db02cc6..7bffcf3eb52 100644 --- a/github/issues_test.go +++ b/github/issues_test.go @@ -11,7 +11,6 @@ import ( "fmt" "net/http" "reflect" - "strings" "testing" "time" ) @@ -20,10 +19,9 @@ func TestIssuesService_List_all(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - wantAcceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeLockReasonPreview} mux.HandleFunc("/issues", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testHeader(t, r, "Accept", strings.Join(wantAcceptHeaders, ", ")) + testHeader(t, r, "Accept", mediaTypeReactionsPreview) testFormValues(t, r, values{ "filter": "all", "state": "closed", @@ -57,10 +55,9 @@ func TestIssuesService_List_owned(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - wantAcceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeLockReasonPreview} mux.HandleFunc("/user/issues", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testHeader(t, r, "Accept", strings.Join(wantAcceptHeaders, ", ")) + testHeader(t, r, "Accept", mediaTypeReactionsPreview) fmt.Fprint(w, `[{"number":1}]`) }) @@ -79,10 +76,9 @@ func TestIssuesService_ListByOrg(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - wantAcceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeLockReasonPreview} mux.HandleFunc("/orgs/o/issues", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testHeader(t, r, "Accept", strings.Join(wantAcceptHeaders, ", ")) + testHeader(t, r, "Accept", mediaTypeReactionsPreview) fmt.Fprint(w, `[{"number":1}]`) }) @@ -109,10 +105,9 @@ func TestIssuesService_ListByRepo(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - wantAcceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeIntegrationPreview} mux.HandleFunc("/repos/o/r/issues", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testHeader(t, r, "Accept", strings.Join(wantAcceptHeaders, ", ")) + testHeader(t, r, "Accept", mediaTypeReactionsPreview) testFormValues(t, r, values{ "milestone": "*", "state": "closed", @@ -155,10 +150,9 @@ func TestIssuesService_Get(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - wantAcceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeLockReasonPreview} mux.HandleFunc("/repos/o/r/issues/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testHeader(t, r, "Accept", strings.Join(wantAcceptHeaders, ", ")) + testHeader(t, r, "Accept", mediaTypeReactionsPreview) fmt.Fprint(w, `{"number":1, "author_association": "MEMBER","labels": [{"url": "u", "name": "n", "color": "c"}]}`) }) @@ -289,7 +283,6 @@ func TestIssuesService_LockWithReason(t *testing.T) { mux.HandleFunc("/repos/o/r/issues/1/lock", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PUT") - testHeader(t, r, "Accept", mediaTypeLockReasonPreview) w.WriteHeader(http.StatusNoContent) }) diff --git a/github/orgs.go b/github/orgs.go index 4fd6bbd5097..1f976cfc218 100644 --- a/github/orgs.go +++ b/github/orgs.go @@ -255,9 +255,6 @@ func (s *OrganizationsService) ListInstallations(ctx context.Context, org string return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeIntegrationPreview) - result := new(OrganizationInstallations) resp, err := s.client.Do(ctx, req, result) if err != nil { diff --git a/github/orgs_test.go b/github/orgs_test.go index e60a01f69fd..6b510130f15 100644 --- a/github/orgs_test.go +++ b/github/orgs_test.go @@ -226,7 +226,6 @@ func TestOrganizationsService_ListInstallations(t *testing.T) { mux.HandleFunc("/orgs/o/installations", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testHeader(t, r, "Accept", mediaTypeIntegrationPreview) fmt.Fprint(w, `{"total_count": 1, "installations": [{ "id": 1, "app_id": 5}]}`) }) @@ -256,7 +255,6 @@ func TestOrganizationsService_ListInstallations_withListOptions(t *testing.T) { mux.HandleFunc("/orgs/o/installations", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testHeader(t, r, "Accept", mediaTypeIntegrationPreview) testFormValues(t, r, values{"page": "2"}) fmt.Fprint(w, `{"total_count": 2, "installations": [{ "id": 2, "app_id": 10}]}`) }) diff --git a/github/pulls.go b/github/pulls.go index b0876d8a2ae..2fafeb0e35d 100644 --- a/github/pulls.go +++ b/github/pulls.go @@ -9,7 +9,6 @@ import ( "bytes" "context" "fmt" - "strings" "time" ) @@ -148,10 +147,6 @@ func (s *PullRequestsService) List(ctx context.Context, owner string, repo strin return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - acceptHeaders := []string{mediaTypeLockReasonPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) - var pulls []*PullRequest resp, err := s.client.Do(ctx, req, &pulls) if err != nil { @@ -179,8 +174,7 @@ func (s *PullRequestsService) ListPullRequestsWithCommit(ctx context.Context, ow } // TODO: remove custom Accept header when this API fully launches. - acceptHeaders := []string{mediaTypeListPullsOrBranchesForCommitPreview, mediaTypeLockReasonPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeListPullsOrBranchesForCommitPreview) var pulls []*PullRequest resp, err := s.client.Do(ctx, req, &pulls) if err != nil { @@ -200,10 +194,6 @@ func (s *PullRequestsService) Get(ctx context.Context, owner string, repo string return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - acceptHeaders := []string{mediaTypeLockReasonPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) - pull := new(PullRequest) resp, err := s.client.Do(ctx, req, pull) if err != nil { @@ -354,10 +344,6 @@ func (s *PullRequestsService) Edit(ctx context.Context, owner string, repo strin return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - acceptHeaders := []string{mediaTypeLockReasonPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) - p := new(PullRequest) resp, err := s.client.Do(ctx, req, p) if err != nil { diff --git a/github/pulls_test.go b/github/pulls_test.go index 67f6d0b0033..15c97f10bd9 100644 --- a/github/pulls_test.go +++ b/github/pulls_test.go @@ -20,10 +20,8 @@ func TestPullRequestsService_List(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - wantAcceptHeaders := []string{mediaTypeLockReasonPreview} mux.HandleFunc("/repos/o/r/pulls", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testHeader(t, r, "Accept", strings.Join(wantAcceptHeaders, ", ")) testFormValues(t, r, values{ "state": "closed", "head": "h", @@ -51,10 +49,9 @@ func TestPullRequestsService_ListPullRequestsWithCommit(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - wantAcceptHeaders := []string{mediaTypeListPullsOrBranchesForCommitPreview, mediaTypeLockReasonPreview} mux.HandleFunc("/repos/o/r/commits/sha/pulls", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testHeader(t, r, "Accept", strings.Join(wantAcceptHeaders, ", ")) + testHeader(t, r, "Accept", mediaTypeListPullsOrBranchesForCommitPreview) testFormValues(t, r, values{ "state": "closed", "head": "h", @@ -90,10 +87,8 @@ func TestPullRequestsService_Get(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - wantAcceptHeaders := []string{mediaTypeLockReasonPreview} mux.HandleFunc("/repos/o/r/pulls/1", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - testHeader(t, r, "Accept", strings.Join(wantAcceptHeaders, ", ")) fmt.Fprint(w, `{"number":1}`) }) @@ -396,10 +391,8 @@ func TestPullRequestsService_Edit(t *testing.T) { for i, tt := range tests { madeRequest := false - wantAcceptHeaders := []string{mediaTypeLockReasonPreview} mux.HandleFunc(fmt.Sprintf("/repos/o/r/pulls/%v", i), func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "PATCH") - testHeader(t, r, "Accept", strings.Join(wantAcceptHeaders, ", ")) testBody(t, r, tt.wantUpdate+"\n") io.WriteString(w, tt.sendResponse) madeRequest = true