FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-gitlab/tools/functional/api/test_deploy_tokens.py at master · Akasurde/python-gitlab · GitHub
Akasurde
python-gitlab
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
python-gitlab
/
tools
/
functional
/
api
/
test_deploy_tokens.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
36 lines (30 loc) · 1.15 KB
Breadcrumbs
python-gitlab
/
tools
/
functional
/
api
/
test_deploy_tokens.py
Copy path
File metadata and controls
36 lines (30 loc) · 1.15 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
34
35
36
def
test_project_deploy_tokens
(
gl
,
project
):
deploy_token
=
project
.
deploytokens
.
create
(
{
"name"
:
"foo"
,
"username"
:
"bar"
,
"expires_at"
:
"2022-01-01"
,
"scopes"
: [
"read_registry"
],
}
)
assert
len
(
project
.
deploytokens
.
list
())
==
1
assert
gl
.
deploytokens
.
list
()
==
project
.
deploytokens
.
list
()
assert
project
.
deploytokens
.
list
()[
0
].
name
==
"foo"
assert
project
.
deploytokens
.
list
()[
0
].
expires_at
==
"2022-01-01T00:00:00.000Z"
assert
project
.
deploytokens
.
list
()[
0
].
scopes
==
[
"read_registry"
]
assert
project
.
deploytokens
.
list
()[
0
].
username
==
"bar"
deploy_token
.
delete
()
assert
len
(
project
.
deploytokens
.
list
())
==
0
assert
len
(
gl
.
deploytokens
.
list
())
==
0
def
test_group_deploy_tokens
(
gl
,
group
):
deploy_token
=
group
.
deploytokens
.
create
(
{
"name"
:
"foo"
,
"scopes"
: [
"read_registry"
],
}
)
assert
len
(
group
.
deploytokens
.
list
())
==
1
assert
gl
.
deploytokens
.
list
()
==
group
.
deploytokens
.
list
()
deploy_token
.
delete
()
assert
len
(
group
.
deploytokens
.
list
())
==
0
assert
len
(
gl
.
deploytokens
.
list
())
==
0
Back
|
FazBrowse Home
|
New Git URL