16
16
17
17
18
18
class TestProject (unittest .TestCase ):
19
- """Base class for GitLab Project tests"""
19
+ """Base class for GitLab Project tests. """
20
20
21
21
def setUp (self ):
22
22
self .gl = Gitlab (
@@ -150,7 +150,7 @@ def resp_create_snippet(url, request):
150
150
scheme = "http" , netloc = "localhost" , path = "/api/v4/projects/1/export" , method = "post" ,
151
151
)
152
152
def resp_create_export (url , request ):
153
- """Common mock for Project Export tests"""
153
+ """Common mock for Project Export tests. """
154
154
content = """{
155
155
"message": "202 Accepted"
156
156
}"""
@@ -162,7 +162,7 @@ def resp_create_export(url, request):
162
162
scheme = "http" , netloc = "localhost" , path = "/api/v4/projects/1/export" , method = "get" ,
163
163
)
164
164
def resp_export_status (url , request ):
165
- """mock for Project Export GET response"""
165
+ """Mock for Project Export GET response. """
166
166
content = """{
167
167
"id": 1,
168
168
"description": "Itaque perspiciatis minima aspernatur",
@@ -218,7 +218,7 @@ def test_download_project_export(self):
218
218
scheme = "http" , netloc = "localhost" , path = "/api/v4/projects/import" , method = "post" ,
219
219
)
220
220
def resp_import_project (url , request ):
221
- """Mock for Project Import POST response"""
221
+ """Mock for Project Import POST response. """
222
222
content = """{
223
223
"id": 1,
224
224
"description": null,
@@ -237,7 +237,7 @@ def resp_import_project(url, request):
237
237
scheme = "http" , netloc = "localhost" , path = "/api/v4/projects/1/import" , method = "get" ,
238
238
)
239
239
def resp_import_status (url , request ):
240
- """Mock for Project Import GET response"""
240
+ """Mock for Project Import GET response. """
241
241
content = """{
242
242
"id": 1,
243
243
"description": "Itaque perspiciatis minima aspernatur corporis consequatur.",
@@ -253,13 +253,9 @@ def resp_import_status(url, request):
253
253
254
254
255
255
@urlmatch (
256
- scheme = "http" ,
257
- netloc = "localhost" ,
258
- path = "/api/v4/import/github" ,
259
- method = "post" ,
256
+ scheme = "http" , netloc = "localhost" , path = "/api/v4/import/github" , method = "post" ,
260
257
)
261
258
def resp_import_github (url , request ):
262
- headers = {"content-type" : "application/json" }
263
259
content = """{
264
260
"id": 27,
265
261
"name": "my-repo",
@@ -276,7 +272,7 @@ def test_import_project(self):
276
272
project_import = self .gl .projects .import_project ("file" , "api-project" )
277
273
self .assertEqual (project_import ["import_status" ], "scheduled" )
278
274
279
- @with_httmock (resp_import_project , resp_import_status )
275
+ @with_httmock (resp_import_status )
280
276
def test_refresh_project_import_status (self ):
281
277
project_import = self .project .imports .get ()
282
278
project_import .refresh ()
0 commit comments