5252"name" :"name" ,
5353 },
5454}
55- delete_project_content = {"message" :"202 Accepted" }
5655upload_file_content = {
5756"alt" :"filename" ,
5857"url" :"/uploads/66dbcd21ec5d24ed6ea225176098d52b/filename.png" ,
@@ -99,7 +98,7 @@ def resp_get_project():
9998
10099
101100@pytest .fixture
102- def resp_post_project ():
101+ def resp_create_project ():
103102with responses .RequestsMock ()as rsps :
104103rsps .add (
105104method = responses .POST ,
@@ -112,7 +111,7 @@ def resp_post_project():
112111
113112
114113@pytest .fixture
115- def resp_post_project_user ():
114+ def resp_create_user_project ():
116115with responses .RequestsMock ()as rsps :
117116rsps .add (
118117method = responses .POST ,
@@ -125,7 +124,7 @@ def resp_post_project_user():
125124
126125
127126@pytest .fixture
128- def resp_post_fork_project ():
127+ def resp_fork_project ():
129128with responses .RequestsMock ()as rsps :
130129rsps .add (
131130method = responses .POST ,
@@ -138,7 +137,7 @@ def resp_post_fork_project():
138137
139138
140139@pytest .fixture
141- def resp_put_project ():
140+ def resp_update_project ():
142141with responses .RequestsMock ()as rsps :
143142rsps .add (
144143method = responses .PUT ,
@@ -164,7 +163,7 @@ def resp_get_project_storage():
164163
165164
166165@pytest .fixture
167- def resp_user_projects ():
166+ def resp_list_user_projects ():
168167with responses .RequestsMock ()as rsps :
169168rsps .add (
170169method = responses .GET ,
@@ -203,7 +202,7 @@ def resp_unstar_project():
203202
204203
205204@pytest .fixture
206- def resp_project_starrers ():
205+ def resp_list_project_starrers ():
207206with responses .RequestsMock ()as rsps :
208207rsps .add (
209208method = responses .GET ,
@@ -216,7 +215,7 @@ def resp_project_starrers():
216215
217216
218217@pytest .fixture
219- def resp_starred_projects ():
218+ def resp_list_starred_projects ():
220219with responses .RequestsMock ()as rsps :
221220rsps .add (
222221method = responses .GET ,
@@ -323,12 +322,12 @@ def resp_unarchive_project():
323322
324323
325324@pytest .fixture
326- def resp_delete_project ():
325+ def resp_delete_project (accepted_content ):
327326with responses .RequestsMock ()as rsps :
328327rsps .add (
329328method = responses .DELETE ,
330329url = "http://localhost/api/v4/projects/1" ,
331- json = delete_project_content ,
330+ json = accepted_content ,
332331content_type = "application/json" ,
333332status = 202 ,
334333 )
@@ -362,12 +361,12 @@ def resp_share_project():
362361
363362
364363@pytest .fixture
365- def resp_unshare_project ():
364+ def resp_unshare_project (no_content ):
366365with responses .RequestsMock ()as rsps :
367366rsps .add (
368367method = responses .DELETE ,
369368url = "http://localhost/api/v4/projects/1/share/1" ,
370- json = None ,
369+ json = no_content ,
371370content_type = "application/json" ,
372371status = 204 ,
373372 )
@@ -388,12 +387,12 @@ def resp_create_fork_relation():
388387
389388
390389@pytest .fixture
391- def resp_delete_fork_relation ():
390+ def resp_delete_fork_relation (no_content ):
392391with responses .RequestsMock ()as rsps :
393392rsps .add (
394393method = responses .DELETE ,
395394url = "http://localhost/api/v4/projects/2/fork" ,
396- json = None ,
395+ json = no_content ,
397396content_type = "application/json" ,
398397status = 204 ,
399398 )
@@ -440,7 +439,7 @@ def resp_start_housekeeping():
440439
441440
442441@pytest .fixture
443- def resp_get_push_rules_project ():
442+ def resp_list_push_rules_project ():
444443with responses .RequestsMock ()as rsps :
445444rsps .add (
446445method = responses .GET ,
@@ -453,7 +452,7 @@ def resp_get_push_rules_project():
453452
454453
455454@pytest .fixture
456- def resp_post_push_rules_project ():
455+ def resp_create_push_rules_project ():
457456with responses .RequestsMock ()as rsps :
458457rsps .add (
459458method = responses .POST ,
@@ -486,7 +485,7 @@ def resp_update_push_rules_project():
486485
487486
488487@pytest .fixture
489- def resp_delete_push_rules_project ():
488+ def resp_delete_push_rules_project (no_content ):
490489with responses .RequestsMock ()as rsps :
491490rsps .add (
492491method = responses .GET ,
@@ -498,7 +497,7 @@ def resp_delete_push_rules_project():
498497rsps .add (
499498method = responses .DELETE ,
500499url = "http://localhost/api/v4/projects/1/push_rule" ,
501- json = None ,
500+ json = no_content ,
502501content_type = "application/json" ,
503502status = 204 ,
504503 )
@@ -555,14 +554,14 @@ def test_list_projects(gl, resp_list_projects):
555554assert projects [0 ].name == "name"
556555
557556
558- def test_list_user_projects (user ,resp_user_projects ):
557+ def test_list_user_projects (user ,resp_list_user_projects ):
559558user_project = user .projects .list ()[0 ]
560559assert isinstance (user_project ,UserProject )
561560assert user_project .name == "name"
562561assert user_project .id == 1
563562
564563
565- def test_list_user_starred_projects (user ,resp_starred_projects ):
564+ def test_list_user_starred_projects (user ,resp_list_starred_projects ):
566565starred_projects = user .starred_projects .list ()[0 ]
567566assert isinstance (starred_projects ,StarredProject )
568567assert starred_projects .name == "name"
@@ -577,13 +576,13 @@ def test_list_project_users(project, resp_list_users):
577576assert user .state == "active"
578577
579578
580- def test_create_project (gl ,resp_post_project ):
579+ def test_create_project (gl ,resp_create_project ):
581580project = gl .projects .create ({"name" :"name" })
582581assert project .id == 1
583582assert project .name == "name"
584583
585584
586- def test_create_user_project (user ,resp_post_project_user ):
585+ def test_create_user_project (user ,resp_create_user_project ):
587586user_project = user .projects .create ({"name" :"name" })
588587assert user_project .id == 1
589588assert user_project .name == "name"
@@ -593,12 +592,12 @@ def test_create_user_project(user, resp_post_project_user):
593592assert user_project .owner .get ("username" )== "owner_username"
594593
595594
596- def test_update_project (project ,resp_put_project ):
595+ def test_update_project (project ,resp_update_project ):
597596project .snippets_enabled = 1
598597project .save ()
599598
600599
601- def test_fork_project (project ,resp_post_fork_project ):
600+ def test_fork_project (project ,resp_fork_project ):
602601fork = project .forks .create ({})
603602assert fork .id == 2
604603assert fork .name == "name"
@@ -624,7 +623,7 @@ def test_unstar_project(project, resp_unstar_project):
624623
625624
626625@pytest .mark .skip (reason = "missing test" )
627- def test_list_project_starrers (project ,resp_project_starrers ):
626+ def test_list_project_starrers (project ,resp_list_project_starrers ):
628627pass
629628
630629
@@ -712,13 +711,13 @@ def test_project_housekeeping(project, resp_start_housekeeping):
712711project .housekeeping ()
713712
714713
715- def test_get_project_push_rules (project ,resp_get_push_rules_project ):
714+ def test_list_project_push_rules (project ,resp_list_push_rules_project ):
716715pr = project .pushrules .get ()
717716assert pr
718717assert pr .deny_delete_tag
719718
720719
721- def test_create_project_push_rule (project ,resp_post_push_rules_project ):
720+ def test_create_project_push_rule (project ,resp_create_push_rules_project ):
722721project .pushrules .create ({"deny_delete_tag" :True })
723722
724723