0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-05-10 03:12:09 +02:00

refactor: update api group integration test

This commit is contained in:
☙◦ The Tablet ❀ GamerGirlandCo ◦❧ 2026-05-06 19:23:41 -04:00
parent 843950818e
commit fd08b21d37
No known key found for this signature in database
GPG Key ID: 924A5F6AF051E87C

View File

@ -57,7 +57,7 @@ func seedOrgWithGroups(t *testing.T) {
}
var teams []*api.Team
userIDs := []int64{4, 5, 8, 9, 10}
userIDs := []int64{4, 5, 8, 9}
userIDIdx := 0
for k, v := range teamPrivs {
@ -98,8 +98,11 @@ func seedOrgWithGroups(t *testing.T) {
for _, group := range allPrivateGroups {
baseTeamURL := "/api/v1/groups/" + strconv.FormatInt(group.ID, 10) + "/teams"
for _, team := range teams {
if team.Permission == api.AccessLevelNameNone {
continue
}
trq := NewRequestWithJSON(t, "PUT", baseTeamURL+"/"+team.Name, &api.CreateOrUpdateRepoGroupTeamOption{
CanCreateIn: new(group.ID%int64(2) == int64(0) && perm_model.ParseAccessMode(string(team.Permission)) > perm_model.AccessModeRead),
CanCreateIn: new(group.ID%int64(2) == int64(1) && perm_model.ParseAccessMode(string(team.Permission)) > perm_model.AccessModeRead),
}).AddTokenAuth(token)
MakeRequest(t, trq, http.StatusNoContent)
assert.NoError(t, err)