@@ -17,8 +17,7 @@ import (
17
17
)
18
18
19
19
func TestActionsService_ListArtifacts (t * testing.T ) {
20
- client , mux , _ , teardown := setup ()
21
- defer teardown ()
20
+ client , mux , _ := setup (t )
22
21
23
22
mux .HandleFunc ("/repos/o/r/actions/artifacts" , func (w http.ResponseWriter , r * http.Request ) {
24
23
testMethod (t , r , "GET" )
@@ -59,26 +58,23 @@ func TestActionsService_ListArtifacts(t *testing.T) {
59
58
}
60
59
61
60
func TestActionsService_ListArtifacts_invalidOwner (t * testing.T ) {
62
- client , _ , _ , teardown := setup ()
63
- defer teardown ()
61
+ client , _ , _ := setup (t )
64
62
65
63
ctx := context .Background ()
66
64
_ , _ , err := client .Actions .ListArtifacts (ctx , "%" , "r" , nil )
67
65
testURLParseError (t , err )
68
66
}
69
67
70
68
func TestActionsService_ListArtifacts_invalidRepo (t * testing.T ) {
71
- client , _ , _ , teardown := setup ()
72
- defer teardown ()
69
+ client , _ , _ := setup (t )
73
70
74
71
ctx := context .Background ()
75
72
_ , _ , err := client .Actions .ListArtifacts (ctx , "o" , "%" , nil )
76
73
testURLParseError (t , err )
77
74
}
78
75
79
76
func TestActionsService_ListArtifacts_notFound (t * testing.T ) {
80
- client , mux , _ , teardown := setup ()
81
- defer teardown ()
77
+ client , mux , _ := setup (t )
82
78
83
79
mux .HandleFunc ("/repos/o/r/actions/artifacts" , func (w http.ResponseWriter , r * http.Request ) {
84
80
testMethod (t , r , "GET" )
@@ -99,8 +95,7 @@ func TestActionsService_ListArtifacts_notFound(t *testing.T) {
99
95
}
100
96
101
97
func TestActionsService_ListWorkflowRunArtifacts (t * testing.T ) {
102
- client , mux , _ , teardown := setup ()
103
- defer teardown ()
98
+ client , mux , _ := setup (t )
104
99
105
100
mux .HandleFunc ("/repos/o/r/actions/runs/1/artifacts" , func (w http.ResponseWriter , r * http.Request ) {
106
101
testMethod (t , r , "GET" )
@@ -141,26 +136,23 @@ func TestActionsService_ListWorkflowRunArtifacts(t *testing.T) {
141
136
}
142
137
143
138
func TestActionsService_ListWorkflowRunArtifacts_invalidOwner (t * testing.T ) {
144
- client , _ , _ , teardown := setup ()
145
- defer teardown ()
139
+ client , _ , _ := setup (t )
146
140
147
141
ctx := context .Background ()
148
142
_ , _ , err := client .Actions .ListWorkflowRunArtifacts (ctx , "%" , "r" , 1 , nil )
149
143
testURLParseError (t , err )
150
144
}
151
145
152
146
func TestActionsService_ListWorkflowRunArtifacts_invalidRepo (t * testing.T ) {
153
- client , _ , _ , teardown := setup ()
154
- defer teardown ()
147
+ client , _ , _ := setup (t )
155
148
156
149
ctx := context .Background ()
157
150
_ , _ , err := client .Actions .ListWorkflowRunArtifacts (ctx , "o" , "%" , 1 , nil )
158
151
testURLParseError (t , err )
159
152
}
160
153
161
154
func TestActionsService_ListWorkflowRunArtifacts_notFound (t * testing.T ) {
162
- client , mux , _ , teardown := setup ()
163
- defer teardown ()
155
+ client , mux , _ := setup (t )
164
156
165
157
mux .HandleFunc ("/repos/o/r/actions/runs/1/artifacts" , func (w http.ResponseWriter , r * http.Request ) {
166
158
testMethod (t , r , "GET" )
@@ -181,8 +173,7 @@ func TestActionsService_ListWorkflowRunArtifacts_notFound(t *testing.T) {
181
173
}
182
174
183
175
func TestActionsService_GetArtifact (t * testing.T ) {
184
- client , mux , _ , teardown := setup ()
185
- defer teardown ()
176
+ client , mux , _ := setup (t )
186
177
187
178
mux .HandleFunc ("/repos/o/r/actions/artifacts/1" , func (w http.ResponseWriter , r * http.Request ) {
188
179
testMethod (t , r , "GET" )
@@ -228,26 +219,23 @@ func TestActionsService_GetArtifact(t *testing.T) {
228
219
}
229
220
230
221
func TestActionsService_GetArtifact_invalidOwner (t * testing.T ) {
231
- client , _ , _ , teardown := setup ()
232
- defer teardown ()
222
+ client , _ , _ := setup (t )
233
223
234
224
ctx := context .Background ()
235
225
_ , _ , err := client .Actions .GetArtifact (ctx , "%" , "r" , 1 )
236
226
testURLParseError (t , err )
237
227
}
238
228
239
229
func TestActionsService_GetArtifact_invalidRepo (t * testing.T ) {
240
- client , _ , _ , teardown := setup ()
241
- defer teardown ()
230
+ client , _ , _ := setup (t )
242
231
243
232
ctx := context .Background ()
244
233
_ , _ , err := client .Actions .GetArtifact (ctx , "o" , "%" , 1 )
245
234
testURLParseError (t , err )
246
235
}
247
236
248
237
func TestActionsService_GetArtifact_notFound (t * testing.T ) {
249
- client , mux , _ , teardown := setup ()
250
- defer teardown ()
238
+ client , mux , _ := setup (t )
251
239
252
240
mux .HandleFunc ("/repos/o/r/actions/artifacts/1" , func (w http.ResponseWriter , r * http.Request ) {
253
241
testMethod (t , r , "GET" )
@@ -268,8 +256,7 @@ func TestActionsService_GetArtifact_notFound(t *testing.T) {
268
256
}
269
257
270
258
func TestActionsService_DownloadArtifact (t * testing.T ) {
271
- client , mux , _ , teardown := setup ()
272
- defer teardown ()
259
+ client , mux , _ := setup (t )
273
260
274
261
mux .HandleFunc ("/repos/o/r/actions/artifacts/1/zip" , func (w http.ResponseWriter , r * http.Request ) {
275
262
testMethod (t , r , "GET" )
@@ -307,26 +294,23 @@ func TestActionsService_DownloadArtifact(t *testing.T) {
307
294
}
308
295
309
296
func TestActionsService_DownloadArtifact_invalidOwner (t * testing.T ) {
310
- client , _ , _ , teardown := setup ()
311
- defer teardown ()
297
+ client , _ , _ := setup (t )
312
298
313
299
ctx := context .Background ()
314
300
_ , _ , err := client .Actions .DownloadArtifact (ctx , "%" , "r" , 1 , 1 )
315
301
testURLParseError (t , err )
316
302
}
317
303
318
304
func TestActionsService_DownloadArtifact_invalidRepo (t * testing.T ) {
319
- client , _ , _ , teardown := setup ()
320
- defer teardown ()
305
+ client , _ , _ := setup (t )
321
306
322
307
ctx := context .Background ()
323
308
_ , _ , err := client .Actions .DownloadArtifact (ctx , "o" , "%" , 1 , 1 )
324
309
testURLParseError (t , err )
325
310
}
326
311
327
312
func TestActionsService_DownloadArtifact_StatusMovedPermanently_dontFollowRedirects (t * testing.T ) {
328
- client , mux , _ , teardown := setup ()
329
- defer teardown ()
313
+ client , mux , _ := setup (t )
330
314
331
315
mux .HandleFunc ("/repos/o/r/actions/artifacts/1/zip" , func (w http.ResponseWriter , r * http.Request ) {
332
316
testMethod (t , r , "GET" )
@@ -341,8 +325,7 @@ func TestActionsService_DownloadArtifact_StatusMovedPermanently_dontFollowRedire
341
325
}
342
326
343
327
func TestActionsService_DownloadArtifact_StatusMovedPermanently_followRedirects (t * testing.T ) {
344
- client , mux , serverURL , teardown := setup ()
345
- defer teardown ()
328
+ client , mux , serverURL := setup (t )
346
329
347
330
mux .HandleFunc ("/repos/o/r/actions/artifacts/1/zip" , func (w http.ResponseWriter , r * http.Request ) {
348
331
testMethod (t , r , "GET" )
@@ -369,8 +352,7 @@ func TestActionsService_DownloadArtifact_StatusMovedPermanently_followRedirects(
369
352
}
370
353
371
354
func TestActionsService_DeleteArtifact (t * testing.T ) {
372
- client , mux , _ , teardown := setup ()
373
- defer teardown ()
355
+ client , mux , _ := setup (t )
374
356
375
357
mux .HandleFunc ("/repos/o/r/actions/artifacts/1" , func (w http.ResponseWriter , r * http.Request ) {
376
358
testMethod (t , r , "DELETE" )
@@ -394,26 +376,23 @@ func TestActionsService_DeleteArtifact(t *testing.T) {
394
376
}
395
377
396
378
func TestActionsService_DeleteArtifact_invalidOwner (t * testing.T ) {
397
- client , _ , _ , teardown := setup ()
398
- defer teardown ()
379
+ client , _ , _ := setup (t )
399
380
400
381
ctx := context .Background ()
401
382
_ , err := client .Actions .DeleteArtifact (ctx , "%" , "r" , 1 )
402
383
testURLParseError (t , err )
403
384
}
404
385
405
386
func TestActionsService_DeleteArtifact_invalidRepo (t * testing.T ) {
406
- client , _ , _ , teardown := setup ()
407
- defer teardown ()
387
+ client , _ , _ := setup (t )
408
388
409
389
ctx := context .Background ()
410
390
_ , err := client .Actions .DeleteArtifact (ctx , "o" , "%" , 1 )
411
391
testURLParseError (t , err )
412
392
}
413
393
414
394
func TestActionsService_DeleteArtifact_notFound (t * testing.T ) {
415
- client , mux , _ , teardown := setup ()
416
- defer teardown ()
395
+ client , mux , _ := setup (t )
417
396
418
397
mux .HandleFunc ("/repos/o/r/actions/artifacts/1" , func (w http.ResponseWriter , r * http.Request ) {
419
398
testMethod (t , r , "DELETE" )
0 commit comments