6
6
package github
7
7
8
8
import (
9
+ "context"
9
10
"encoding/json"
10
11
"fmt"
11
12
"net/http"
@@ -26,7 +27,7 @@ func TestActivityService_ListEvents(t *testing.T) {
26
27
})
27
28
28
29
opt := & ListOptions {Page : 2 }
29
- events , _ , err := client .Activity .ListEvents (opt )
30
+ events , _ , err := client .Activity .ListEvents (context . Background (), opt )
30
31
if err != nil {
31
32
t .Errorf ("Activities.ListEvents returned error: %v" , err )
32
33
}
@@ -50,7 +51,7 @@ func TestActivityService_ListRepositoryEvents(t *testing.T) {
50
51
})
51
52
52
53
opt := & ListOptions {Page : 2 }
53
- events , _ , err := client .Activity .ListRepositoryEvents ("o" , "r" , opt )
54
+ events , _ , err := client .Activity .ListRepositoryEvents (context . Background (), "o" , "r" , opt )
54
55
if err != nil {
55
56
t .Errorf ("Activities.ListRepositoryEvents returned error: %v" , err )
56
57
}
@@ -62,7 +63,7 @@ func TestActivityService_ListRepositoryEvents(t *testing.T) {
62
63
}
63
64
64
65
func TestActivityService_ListRepositoryEvents_invalidOwner (t * testing.T ) {
65
- _ , _ , err := client .Activity .ListRepositoryEvents ("%" , "%" , nil )
66
+ _ , _ , err := client .Activity .ListRepositoryEvents (context . Background (), "%" , "%" , nil )
66
67
testURLParseError (t , err )
67
68
}
68
69
@@ -79,7 +80,7 @@ func TestActivityService_ListIssueEventsForRepository(t *testing.T) {
79
80
})
80
81
81
82
opt := & ListOptions {Page : 2 }
82
- events , _ , err := client .Activity .ListIssueEventsForRepository ("o" , "r" , opt )
83
+ events , _ , err := client .Activity .ListIssueEventsForRepository (context . Background (), "o" , "r" , opt )
83
84
if err != nil {
84
85
t .Errorf ("Activities.ListIssueEventsForRepository returned error: %v" , err )
85
86
}
@@ -91,7 +92,7 @@ func TestActivityService_ListIssueEventsForRepository(t *testing.T) {
91
92
}
92
93
93
94
func TestActivityService_ListIssueEventsForRepository_invalidOwner (t * testing.T ) {
94
- _ , _ , err := client .Activity .ListIssueEventsForRepository ("%" , "%" , nil )
95
+ _ , _ , err := client .Activity .ListIssueEventsForRepository (context . Background (), "%" , "%" , nil )
95
96
testURLParseError (t , err )
96
97
}
97
98
@@ -108,7 +109,7 @@ func TestActivityService_ListEventsForRepoNetwork(t *testing.T) {
108
109
})
109
110
110
111
opt := & ListOptions {Page : 2 }
111
- events , _ , err := client .Activity .ListEventsForRepoNetwork ("o" , "r" , opt )
112
+ events , _ , err := client .Activity .ListEventsForRepoNetwork (context . Background (), "o" , "r" , opt )
112
113
if err != nil {
113
114
t .Errorf ("Activities.ListEventsForRepoNetwork returned error: %v" , err )
114
115
}
@@ -120,7 +121,7 @@ func TestActivityService_ListEventsForRepoNetwork(t *testing.T) {
120
121
}
121
122
122
123
func TestActivityService_ListEventsForRepoNetwork_invalidOwner (t * testing.T ) {
123
- _ , _ , err := client .Activity .ListEventsForRepoNetwork ("%" , "%" , nil )
124
+ _ , _ , err := client .Activity .ListEventsForRepoNetwork (context . Background (), "%" , "%" , nil )
124
125
testURLParseError (t , err )
125
126
}
126
127
@@ -137,7 +138,7 @@ func TestActivityService_ListEventsForOrganization(t *testing.T) {
137
138
})
138
139
139
140
opt := & ListOptions {Page : 2 }
140
- events , _ , err := client .Activity .ListEventsForOrganization ("o" , opt )
141
+ events , _ , err := client .Activity .ListEventsForOrganization (context . Background (), "o" , opt )
141
142
if err != nil {
142
143
t .Errorf ("Activities.ListEventsForOrganization returned error: %v" , err )
143
144
}
@@ -149,7 +150,7 @@ func TestActivityService_ListEventsForOrganization(t *testing.T) {
149
150
}
150
151
151
152
func TestActivityService_ListEventsForOrganization_invalidOrg (t * testing.T ) {
152
- _ , _ , err := client .Activity .ListEventsForOrganization ("%" , nil )
153
+ _ , _ , err := client .Activity .ListEventsForOrganization (context . Background (), "%" , nil )
153
154
testURLParseError (t , err )
154
155
}
155
156
@@ -166,7 +167,7 @@ func TestActivityService_ListEventsPerformedByUser_all(t *testing.T) {
166
167
})
167
168
168
169
opt := & ListOptions {Page : 2 }
169
- events , _ , err := client .Activity .ListEventsPerformedByUser ("u" , false , opt )
170
+ events , _ , err := client .Activity .ListEventsPerformedByUser (context . Background (), "u" , false , opt )
170
171
if err != nil {
171
172
t .Errorf ("Events.ListPerformedByUser returned error: %v" , err )
172
173
}
@@ -186,7 +187,7 @@ func TestActivityService_ListEventsPerformedByUser_publicOnly(t *testing.T) {
186
187
fmt .Fprint (w , `[{"id":"1"},{"id":"2"}]` )
187
188
})
188
189
189
- events , _ , err := client .Activity .ListEventsPerformedByUser ("u" , true , nil )
190
+ events , _ , err := client .Activity .ListEventsPerformedByUser (context . Background (), "u" , true , nil )
190
191
if err != nil {
191
192
t .Errorf ("Events.ListPerformedByUser returned error: %v" , err )
192
193
}
@@ -198,7 +199,7 @@ func TestActivityService_ListEventsPerformedByUser_publicOnly(t *testing.T) {
198
199
}
199
200
200
201
func TestActivityService_ListEventsPerformedByUser_invalidUser (t * testing.T ) {
201
- _ , _ , err := client .Activity .ListEventsPerformedByUser ("%" , false , nil )
202
+ _ , _ , err := client .Activity .ListEventsPerformedByUser (context . Background (), "%" , false , nil )
202
203
testURLParseError (t , err )
203
204
}
204
205
@@ -215,7 +216,7 @@ func TestActivityService_ListEventsReceivedByUser_all(t *testing.T) {
215
216
})
216
217
217
218
opt := & ListOptions {Page : 2 }
218
- events , _ , err := client .Activity .ListEventsReceivedByUser ("u" , false , opt )
219
+ events , _ , err := client .Activity .ListEventsReceivedByUser (context . Background (), "u" , false , opt )
219
220
if err != nil {
220
221
t .Errorf ("Events.ListReceivedByUser returned error: %v" , err )
221
222
}
@@ -235,7 +236,7 @@ func TestActivityService_ListEventsReceivedByUser_publicOnly(t *testing.T) {
235
236
fmt .Fprint (w , `[{"id":"1"},{"id":"2"}]` )
236
237
})
237
238
238
- events , _ , err := client .Activity .ListEventsReceivedByUser ("u" , true , nil )
239
+ events , _ , err := client .Activity .ListEventsReceivedByUser (context . Background (), "u" , true , nil )
239
240
if err != nil {
240
241
t .Errorf ("Events.ListReceivedByUser returned error: %v" , err )
241
242
}
@@ -247,7 +248,7 @@ func TestActivityService_ListEventsReceivedByUser_publicOnly(t *testing.T) {
247
248
}
248
249
249
250
func TestActivityService_ListEventsReceivedByUser_invalidUser (t * testing.T ) {
250
- _ , _ , err := client .Activity .ListEventsReceivedByUser ("%" , false , nil )
251
+ _ , _ , err := client .Activity .ListEventsReceivedByUser (context . Background (), "%" , false , nil )
251
252
testURLParseError (t , err )
252
253
}
253
254
@@ -264,7 +265,7 @@ func TestActivityService_ListUserEventsForOrganization(t *testing.T) {
264
265
})
265
266
266
267
opt := & ListOptions {Page : 2 }
267
- events , _ , err := client .Activity .ListUserEventsForOrganization ("o" , "u" , opt )
268
+ events , _ , err := client .Activity .ListUserEventsForOrganization (context . Background (), "o" , "u" , opt )
268
269
if err != nil {
269
270
t .Errorf ("Activities.ListUserEventsForOrganization returned error: %v" , err )
270
271
}
0 commit comments