@@ -175,12 +175,6 @@ func Test_UpdatePullRequest(t *testing.T) {
175175 }
176176
177177 // Mock PR for when there are no updates but we still need a response
178- mockNoUpdatePR := & github.PullRequest {
179- Number : github .Ptr (42 ),
180- Title : github .Ptr ("Test PR" ),
181- State : github .Ptr ("open" ),
182- }
183-
184178 mockPRWithReviewers := & github.PullRequest {
185179 Number : github .Ptr (42 ),
186180 Title : github .Ptr ("Test PR" ),
@@ -338,11 +332,6 @@ func Test_UpdatePullRequest(t *testing.T) {
338332 {
339333 name : "request reviewers fails" ,
340334 mockedClient : mock .NewMockedHTTPClient (
341- // First it gets the PR (no fields to update)
342- mock .WithRequestMatch (
343- mock .GetReposPullsByOwnerByRepoByPullNumber ,
344- mockNoUpdatePR ,
345- ),
346335 // Then reviewer request fails
347336 mock .WithRequestMatchHandler (
348337 mock .PostReposPullsRequestedReviewersByOwnerByRepoByPullNumber ,
@@ -615,25 +604,6 @@ func Test_UpdatePullRequest_Draft(t *testing.T) {
615604 err = json .Unmarshal ([]byte (textContent .Text ), & returnedPR )
616605 require .NoError (t , err )
617606 assert .Equal (t , * tc .expectedPR .Number , * returnedPR .Number )
618- if tc .expectedPR .Title != nil {
619- assert .Equal (t , * tc .expectedPR .Title , * returnedPR .Title )
620- }
621- if tc .expectedPR .Body != nil {
622- assert .Equal (t , * tc .expectedPR .Body , * returnedPR .Body )
623- }
624- if tc .expectedPR .State != nil {
625- assert .Equal (t , * tc .expectedPR .State , * returnedPR .State )
626- }
627- if tc .expectedPR .Base != nil && tc .expectedPR .Base .Ref != nil {
628- assert .NotNil (t , returnedPR .Base )
629- assert .Equal (t , * tc .expectedPR .Base .Ref , * returnedPR .Base .Ref )
630- }
631- if tc .expectedPR .MaintainerCanModify != nil {
632- assert .Equal (t , * tc .expectedPR .MaintainerCanModify , * returnedPR .MaintainerCanModify )
633- }
634- if tc .expectedPR .Draft != nil {
635- assert .Equal (t , * tc .expectedPR .Draft , * returnedPR .Draft )
636- }
637607 })
638608 }
639609}
0 commit comments