Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit263fe3d

Browse files
nejchJohnVillalovos
authored andcommitted
test(cli): add tests for token scopes
1 parentd9126cd commit263fe3d

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

‎tests/functional/cli/test_cli_resource_access_tokens.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,41 @@ def test_list_project_access_tokens(gitlab_cli, project):
88
assertret.success
99

1010

11+
deftest_create_project_access_token_with_scopes(gitlab_cli,project):
12+
cmd= [
13+
"project-access-token",
14+
"create",
15+
"--project-id",
16+
project.id,
17+
"--name",
18+
"test-token",
19+
"--scopes",
20+
"api,read_repository",
21+
]
22+
ret=gitlab_cli(cmd)
23+
24+
assertret.success
25+
26+
1127
@pytest.mark.skip(reason="Requires GitLab 14.7")
1228
deftest_list_group_access_tokens(gitlab_cli,group):
1329
cmd= ["group-access-token","list","--group-id",group.id]
1430
ret=gitlab_cli(cmd)
1531

1632
assertret.success
33+
34+
35+
deftest_create_group_access_token_with_scopes(gitlab_cli,group):
36+
cmd= [
37+
"group-access-token",
38+
"create",
39+
"--group-id",
40+
group.id,
41+
"--name",
42+
"test-token",
43+
"--scopes",
44+
"api,read_repository",
45+
]
46+
ret=gitlab_cli(cmd)
47+
48+
assertret.success
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
deftest_create_user_impersonation_token_with_scopes(gitlab_cli,user):
2+
cmd= [
3+
"user-impersonation-token",
4+
"create",
5+
"--user-id",
6+
user.id,
7+
"--name",
8+
"test-token",
9+
"--scopes",
10+
"api,read_user",
11+
]
12+
ret=gitlab_cli(cmd)
13+
14+
assertret.success

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp