@@ -178,7 +178,7 @@ func TestExecute(t *testing.T) {
178
178
},
179
179
{
180
180
desc : "With unknown configured scopes" ,
181
- PATConfig : config.PATConfig {AllowedScopes : []string {"unknown_repository " }},
181
+ PATConfig : config.PATConfig {AllowedScopes : []string {"read_reposotory " }}, //nolint:misspell //testing purpose
182
182
arguments : & commandargs.Shell {
183
183
GitlabKeyId : "default" ,
184
184
SshArgs : []string {cmdname , "newtoken" , "read_api,read_repository" },
@@ -192,20 +192,20 @@ func TestExecute(t *testing.T) {
192
192
PATConfig : config.PATConfig {AllowedScopes : []string {"read_api" , "read_repository" }},
193
193
arguments : & commandargs.Shell {
194
194
GitlabKeyId : "default" ,
195
- SshArgs : []string {cmdname , "newtoken" , "read_api,unknown_repository " },
195
+ SshArgs : []string {cmdname , "newtoken" , "read_api,read_reposotory " }, //nolint:misspell //testing purpose
196
196
},
197
197
expectedOutput : "Token: YXuxvUgCEmeePY3G1YAa\n " +
198
198
"Scopes: read_api\n " +
199
199
"Expires: 9001-11-17\n " ,
200
200
},
201
201
{
202
202
desc : "With matching unknown requested scopes" ,
203
- PATConfig : config.PATConfig {AllowedScopes : []string {"read_api" , "unknown_repository " }},
203
+ PATConfig : config.PATConfig {AllowedScopes : []string {"read_api" , "read_reposotory " }}, //nolint:misspell //testing purpose
204
204
arguments : & commandargs.Shell {
205
205
GitlabKeyId : "invalidscope" ,
206
- SshArgs : []string {cmdname , "newtoken" , "unknown_repository " },
206
+ SshArgs : []string {cmdname , "newtoken" , "read_reposotory " }, //nolint:misspell //testing purpose
207
207
},
208
- expectedError : "Invalid scope: 'unknown_repository '. Valid scopes are: [\" api\" , \" create_runner\" , \" k8s_proxy\" , \" read_api\" , \" read_registry\" , \" read_repository\" , \" read_user\" , \" write_registry\" , \" write_repository\" ]" ,
208
+ expectedError : "Invalid scope: 'read_reposotory '. Valid scopes are: [\" api\" , \" create_runner\" , \" k8s_proxy\" , \" read_api\" , \" read_registry\" , \" read_repository\" , \" read_user\" , \" write_registry\" , \" write_repository\" ]" ,
209
209
},
210
210
}
211
211
0 commit comments