b81847d03d
close #526 * [x] functions * [x] tests Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/537 Reviewed-by: Andrew Thornton <art27@cantab.net> Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: 6543 <6543@obermui.de> Co-committed-by: 6543 <6543@obermui.de>
25 lines
712 B
Go
25 lines
712 B
Go
// Copyright 2021 The Gitea Authors. All rights reserved.
|
|
// Use of this source code is governed by a MIT-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package gitea
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func createTestOrgTeams(t *testing.T, c *Client, org, name string, accessMode AccessMode, units []RepoUnitType) (*Team, error) {
|
|
team, _, e := c.CreateTeam(org, CreateTeamOption{
|
|
Name: name,
|
|
Description: name + "'s team desc",
|
|
Permission: accessMode,
|
|
CanCreateOrgRepo: false,
|
|
IncludesAllRepositories: false,
|
|
Units: units,
|
|
})
|
|
assert.NoError(t, e)
|
|
assert.NotNil(t, team)
|
|
return team, e
|
|
}
|