File tree 18 files changed +21
-70
lines changed
18 files changed +21
-70
lines changed Original file line number Diff line number Diff line change @@ -21,11 +21,6 @@ def created_content():
21
21
return {"message" : "201 Created" }
22
22
23
23
24
- @pytest .fixture
25
- def no_content ():
26
- return {"message" : "204 No Content" }
27
-
28
-
29
24
@pytest .fixture
30
25
def resp_export (accepted_content , binary_content ):
31
26
"""Common fixture for group and project exports."""
Original file line number Diff line number Diff line change @@ -97,13 +97,11 @@ def resp_update_badge():
97
97
98
98
99
99
@pytest .fixture ()
100
- def resp_delete_badge (no_content ):
100
+ def resp_delete_badge ():
101
101
with responses .RequestsMock () as rsps :
102
102
rsps .add (
103
103
method = responses .DELETE ,
104
104
url = re .compile (r"http://localhost/api/v4/(projects|groups)/1/badges/1" ),
105
- json = no_content ,
106
- content_type = "application/json" ,
107
105
status = 204 ,
108
106
)
109
107
yield rsps
Original file line number Diff line number Diff line change @@ -75,8 +75,6 @@ def resp_revoke_group_access_token():
75
75
rsps .add (
76
76
method = responses .DELETE ,
77
77
url = "http://localhost/api/v4/groups/1/access_tokens/42" ,
78
- json = content ,
79
- content_type = "application/json" ,
80
78
status = 204 ,
81
79
)
82
80
rsps .add (
Original file line number Diff line number Diff line change @@ -215,7 +215,7 @@ def resp_update_push_rules_group():
215
215
216
216
217
217
@pytest .fixture
218
- def resp_delete_push_rules_group (no_content ):
218
+ def resp_delete_push_rules_group ():
219
219
with responses .RequestsMock () as rsps :
220
220
rsps .add (
221
221
method = responses .GET ,
@@ -227,15 +227,13 @@ def resp_delete_push_rules_group(no_content):
227
227
rsps .add (
228
228
method = responses .DELETE ,
229
229
url = "http://localhost/api/v4/groups/1/push_rule" ,
230
- json = no_content ,
231
- content_type = "application/json" ,
232
230
status = 204 ,
233
231
)
234
232
yield rsps
235
233
236
234
237
235
@pytest .fixture
238
- def resp_list_ldap_group_links (no_content ):
236
+ def resp_list_ldap_group_links ():
239
237
with responses .RequestsMock () as rsps :
240
238
rsps .add (
241
239
method = responses .GET ,
@@ -292,7 +290,7 @@ def resp_create_saml_group_link():
292
290
293
291
294
292
@pytest .fixture
295
- def resp_delete_saml_group_link (no_content ):
293
+ def resp_delete_saml_group_link ():
296
294
with responses .RequestsMock () as rsps :
297
295
rsps .add (
298
296
method = responses .POST ,
@@ -309,8 +307,6 @@ def resp_delete_saml_group_link(no_content):
309
307
rsps .add (
310
308
method = responses .DELETE ,
311
309
url = "http://localhost/api/v4/groups/1/saml_group_links/saml-group-1" ,
312
- json = no_content ,
313
- content_type = "application/json" ,
314
310
status = 204 ,
315
311
)
316
312
yield rsps
Original file line number Diff line number Diff line change @@ -25,13 +25,11 @@ def resp_artifacts_by_ref_name(binary_content):
25
25
26
26
27
27
@pytest .fixture
28
- def resp_project_artifacts_delete (no_content ):
28
+ def resp_project_artifacts_delete ():
29
29
with responses .RequestsMock () as rsps :
30
30
rsps .add (
31
31
method = responses .DELETE ,
32
32
url = "http://localhost/api/v4/projects/1/artifacts" ,
33
- json = no_content ,
34
- content_type = "application/json" ,
35
33
status = 204 ,
36
34
)
37
35
yield rsps
Original file line number Diff line number Diff line change 23
23
24
24
25
25
@pytest .fixture
26
- def resp_create_group_member (no_content ):
26
+ def resp_create_group_member ():
27
27
with responses .RequestsMock () as rsps :
28
28
rsps .add (
29
29
method = responses .POST ,
@@ -49,13 +49,11 @@ def resp_list_billable_group_members():
49
49
50
50
51
51
@pytest .fixture
52
- def resp_delete_billable_group_member (no_content ):
52
+ def resp_delete_billable_group_member ():
53
53
with responses .RequestsMock () as rsps :
54
54
rsps .add (
55
55
method = responses .DELETE ,
56
56
url = "http://localhost/api/v4/groups/1/billable_members/1" ,
57
- json = no_content ,
58
- content_type = "application/json" ,
59
57
status = 204 ,
60
58
)
61
59
yield rsps
Original file line number Diff line number Diff line change @@ -137,33 +137,29 @@ def resp_get_package():
137
137
138
138
139
139
@pytest .fixture
140
- def resp_delete_package (no_content ):
140
+ def resp_delete_package ():
141
141
with responses .RequestsMock () as rsps :
142
142
rsps .add (
143
143
method = responses .DELETE ,
144
144
url = "http://localhost/api/v4/projects/1/packages/1" ,
145
- json = no_content ,
146
- content_type = "application/json" ,
147
145
status = 204 ,
148
146
)
149
147
yield rsps
150
148
151
149
152
150
@pytest .fixture
153
- def resp_delete_package_file (no_content ):
151
+ def resp_delete_package_file ():
154
152
with responses .RequestsMock () as rsps :
155
153
rsps .add (
156
154
method = responses .DELETE ,
157
155
url = "http://localhost/api/v4/projects/1/packages/1/package_files/1" ,
158
- json = no_content ,
159
- content_type = "application/json" ,
160
156
status = 204 ,
161
157
)
162
158
yield rsps
163
159
164
160
165
161
@pytest .fixture
166
- def resp_delete_package_file_list (no_content ):
162
+ def resp_delete_package_file_list ():
167
163
with responses .RequestsMock () as rsps :
168
164
rsps .add (
169
165
method = responses .GET ,
@@ -178,8 +174,6 @@ def resp_delete_package_file_list(no_content):
178
174
rsps .add (
179
175
method = responses .DELETE ,
180
176
url = f"http://localhost/api/v4/projects/1/packages/1/package_files/{ pkg_file_id } " ,
181
- json = no_content ,
182
- content_type = "application/json" ,
183
177
status = 204 ,
184
178
)
185
179
yield rsps
Original file line number Diff line number Diff line change @@ -81,13 +81,11 @@ def resp_get_personal_access_token_self():
81
81
82
82
83
83
@pytest .fixture
84
- def resp_delete_personal_access_token (no_content ):
84
+ def resp_delete_personal_access_token ():
85
85
with responses .RequestsMock () as rsps :
86
86
rsps .add (
87
87
method = responses .DELETE ,
88
88
url = single_token_url ,
89
- json = no_content ,
90
- content_type = "application/json" ,
91
89
status = 204 ,
92
90
)
93
91
yield rsps
Original file line number Diff line number Diff line change @@ -75,8 +75,6 @@ def resp_revoke_project_access_token():
75
75
rsps .add (
76
76
method = responses .DELETE ,
77
77
url = "http://localhost/api/v4/projects/1/access_tokens/42" ,
78
- json = content ,
79
- content_type = "application/json" ,
80
78
status = 204 ,
81
79
)
82
80
rsps .add (
Original file line number Diff line number Diff line change @@ -147,13 +147,11 @@ def resp_mr_approval_rules():
147
147
148
148
149
149
@pytest .fixture
150
- def resp_delete_mr_approval_rule (no_content ):
150
+ def resp_delete_mr_approval_rule ():
151
151
with responses .RequestsMock () as rsps :
152
152
rsps .add (
153
153
method = responses .DELETE ,
154
154
url = "http://localhost/api/v4/projects/1/merge_requests/1/approval_rules/1" ,
155
- json = no_content ,
156
- content_type = "application/json" ,
157
155
status = 204 ,
158
156
)
159
157
yield rsps
Original file line number Diff line number Diff line change @@ -361,13 +361,11 @@ def resp_share_project():
361
361
362
362
363
363
@pytest .fixture
364
- def resp_unshare_project (no_content ):
364
+ def resp_unshare_project ():
365
365
with responses .RequestsMock () as rsps :
366
366
rsps .add (
367
367
method = responses .DELETE ,
368
368
url = "http://localhost/api/v4/projects/1/share/1" ,
369
- json = no_content ,
370
- content_type = "application/json" ,
371
369
status = 204 ,
372
370
)
373
371
yield rsps
@@ -387,13 +385,11 @@ def resp_create_fork_relation():
387
385
388
386
389
387
@pytest .fixture
390
- def resp_delete_fork_relation (no_content ):
388
+ def resp_delete_fork_relation ():
391
389
with responses .RequestsMock () as rsps :
392
390
rsps .add (
393
391
method = responses .DELETE ,
394
392
url = "http://localhost/api/v4/projects/2/fork" ,
395
- json = no_content ,
396
- content_type = "application/json" ,
397
393
status = 204 ,
398
394
)
399
395
yield rsps
@@ -485,7 +481,7 @@ def resp_update_push_rules_project():
485
481
486
482
487
483
@pytest .fixture
488
- def resp_delete_push_rules_project (no_content ):
484
+ def resp_delete_push_rules_project ():
489
485
with responses .RequestsMock () as rsps :
490
486
rsps .add (
491
487
method = responses .GET ,
@@ -497,8 +493,6 @@ def resp_delete_push_rules_project(no_content):
497
493
rsps .add (
498
494
method = responses .DELETE ,
499
495
url = "http://localhost/api/v4/projects/1/push_rule" ,
500
- json = no_content ,
501
- content_type = "application/json" ,
502
496
status = 204 ,
503
497
)
504
498
yield rsps
Original file line number Diff line number Diff line change @@ -59,13 +59,11 @@ def resp_get_registry_repository():
59
59
60
60
61
61
@pytest .fixture
62
- def resp_delete_registry_repository (no_content ):
62
+ def resp_delete_registry_repository ():
63
63
with responses .RequestsMock () as rsps :
64
64
rsps .add (
65
65
method = responses .DELETE ,
66
66
url = "http://localhost/api/v4/projects/1/registry/repositories/1" ,
67
- json = no_content ,
68
- content_type = "application/json" ,
69
67
status = 204 ,
70
68
)
71
69
yield rsps
Original file line number Diff line number Diff line change @@ -101,13 +101,11 @@ def resp_update_link():
101
101
102
102
103
103
@pytest .fixture
104
- def resp_delete_link (no_content ):
104
+ def resp_delete_link ():
105
105
with responses .RequestsMock () as rsps :
106
106
rsps .add (
107
107
method = responses .DELETE ,
108
108
url = link_id_url ,
109
- json = link_content ,
110
- content_type = "application/json" ,
111
109
status = 204 ,
112
110
)
113
111
yield rsps
Original file line number Diff line number Diff line change @@ -65,13 +65,11 @@ def resp_download_secure_file(binary_content):
65
65
66
66
67
67
@pytest .fixture
68
- def resp_remove_secure_file (no_content ):
68
+ def resp_remove_secure_file ():
69
69
with responses .RequestsMock () as rsps :
70
70
rsps .add (
71
71
method = responses .DELETE ,
72
72
url = "http://localhost/api/v4/projects/1/secure_files/1" ,
73
- json = no_content ,
74
- content_type = "application/json" ,
75
73
status = 204 ,
76
74
)
77
75
yield rsps
Original file line number Diff line number Diff line change @@ -66,8 +66,6 @@ def resp_mark_all_as_done():
66
66
rsps .add (
67
67
method = responses .POST ,
68
68
url = "http://localhost/api/v4/todos/mark_as_done" ,
69
- json = {},
70
- content_type = "application/json" ,
71
69
status = 204 ,
72
70
)
73
71
yield rsps
Original file line number Diff line number Diff line change @@ -78,13 +78,11 @@ def resp_update_topic():
78
78
79
79
80
80
@pytest .fixture
81
- def resp_delete_topic (no_content ):
81
+ def resp_delete_topic ():
82
82
with responses .RequestsMock () as rsps :
83
83
rsps .add (
84
84
method = responses .DELETE ,
85
85
url = topic_url ,
86
- json = no_content ,
87
- content_type = "application/json" ,
88
86
status = 204 ,
89
87
)
90
88
yield rsps
Original file line number Diff line number Diff line change @@ -152,13 +152,11 @@ def resp_get_user_status():
152
152
153
153
154
154
@pytest .fixture
155
- def resp_delete_user_identity (no_content ):
155
+ def resp_delete_user_identity ():
156
156
with responses .RequestsMock () as rsps :
157
157
rsps .add (
158
158
method = responses .DELETE ,
159
159
url = "http://localhost/api/v4/users/1/identities/test_provider" ,
160
- json = no_content ,
161
- content_type = "application/json" ,
162
160
status = 204 ,
163
161
)
164
162
yield rsps
Original file line number Diff line number Diff line change @@ -87,13 +87,11 @@ def resp_update_variable():
87
87
88
88
89
89
@pytest .fixture
90
- def resp_delete_variable (no_content ):
90
+ def resp_delete_variable ():
91
91
with responses .RequestsMock () as rsps :
92
92
rsps .add (
93
93
method = responses .DELETE ,
94
94
url = variables_key_url ,
95
- json = no_content ,
96
- content_type = "application/json" ,
97
95
status = 204 ,
98
96
)
99
97
yield rsps
You can’t perform that action at this time.
0 commit comments