FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-gitlab/tests/functional/api/test_registry.py at main · python-gitlab/python-gitlab · GitHub
python-gitlab
python-gitlab
Repository navigation
Code
Issues
16
(16)
Pull requests
15
(15)
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
python-gitlab
/
tests
/
functional
/
api
/
test_registry.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
33 lines (24 loc) · 1.1 KB
Breadcrumbs
python-gitlab
/
tests
/
functional
/
api
/
test_registry.py
Copy path
File metadata and controls
33 lines (24 loc) · 1.1 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import
pytest
from
gitlab
import
Gitlab
from
gitlab
.
v4
.
objects
import
Project
,
ProjectRegistryProtectionRule
@
pytest
.
fixture
(
scope
=
"module"
,
autouse
=
True
)
def
protected_registry_feature
(
gl
:
Gitlab
):
gl
.
features
.
set
(
name
=
"container_registry_protected_containers"
,
value
=
True
)
@
pytest
.
mark
.
skip
(
reason
=
"Not released yet"
)
def
test_project_protected_registry
(
project
:
Project
):
rules
=
project
.
registry_protection_repository_rules
.
list
()
assert
isinstance
(
rules
,
list
)
protected_registry
=
project
.
registry_protection_repository_rules
.
create
(
{
"repository_path_pattern"
:
"test/image"
,
"minimum_access_level_for_push"
:
"maintainer"
,
}
)
assert
isinstance
(
protected_registry
,
ProjectRegistryProtectionRule
)
assert
protected_registry
.
repository_path_pattern
==
"test/image"
protected_registry
.
minimum_access_level_for_push
=
"owner"
protected_registry
.
save
()
assert
protected_registry
.
minimum_access_level_for_push
==
"owner"
protected_registry
.
delete
()
rules
=
project
.
registry_protection_repository_rules
.
list
()
assert
rules
==
[]
Back
|
FazBrowse Home
|
New Git URL