@@ -21,7 +21,7 @@ def resp_list_protected_registries():
21
21
with responses .RequestsMock () as rsps :
22
22
rsps .add (
23
23
method = responses .GET ,
24
- url = "http://localhost/api/v4/projects/1/registry/repository/ protection/rules" ,
24
+ url = "http://localhost/api/v4/projects/1/registry/protection/repository /rules" ,
25
25
json = [protected_registry_content ],
26
26
content_type = "application/json" ,
27
27
status = 200 ,
@@ -34,7 +34,7 @@ def resp_create_protected_registry():
34
34
with responses .RequestsMock () as rsps :
35
35
rsps .add (
36
36
method = responses .POST ,
37
- url = "http://localhost/api/v4/projects/1/registry/repository/ protection/rules" ,
37
+ url = "http://localhost/api/v4/projects/1/registry/protection/repository /rules" ,
38
38
json = protected_registry_content ,
39
39
content_type = "application/json" ,
40
40
status = 201 ,
@@ -50,7 +50,7 @@ def resp_update_protected_registry():
50
50
with responses .RequestsMock () as rsps :
51
51
rsps .add (
52
52
method = responses .PATCH ,
53
- url = "http://localhost/api/v4/projects/1/registry/repository/ protection/rules/1" ,
53
+ url = "http://localhost/api/v4/projects/1/registry/protection/repository /rules/1" ,
54
54
json = updated_content ,
55
55
content_type = "application/json" ,
56
56
status = 200 ,
@@ -59,13 +59,13 @@ def resp_update_protected_registry():
59
59
60
60
61
61
def test_list_project_protected_registries (project , resp_list_protected_registries ):
62
- protected_registry = project .registry_repository_protection_rules .list ()[0 ]
62
+ protected_registry = project .registry_protection_repository_rules .list ()[0 ]
63
63
assert isinstance (protected_registry , ProjectRegistryRepositoryProtectionRule )
64
64
assert protected_registry .repository_path_pattern == "test/image"
65
65
66
66
67
67
def test_create_project_protected_registry (project , resp_create_protected_registry ):
68
- protected_registry = project .registry_repository_protection_rules .create (
68
+ protected_registry = project .registry_protection_repository_rules .create (
69
69
{
70
70
"repository_path_pattern" : "test/image" ,
71
71
"minimum_access_level_for_push" : "maintainer" ,
@@ -76,7 +76,7 @@ def test_create_project_protected_registry(project, resp_create_protected_regist
76
76
77
77
78
78
def test_update_project_protected_registry (project , resp_update_protected_registry ):
79
- updated = project .registry_repository_protection_rules .update (
79
+ updated = project .registry_protection_repository_rules .update (
80
80
1 , {"repository_path_pattern" : "abc*" }
81
81
)
82
82
assert updated ["repository_path_pattern" ] == "abc*"
0 commit comments