mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-03 00:45:22 +02:00
Add testifylint to lint checks (#4535)
go-require lint is ignored for now Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4535 Reviewed-by: Gusted <gusted@noreply.codeberg.org> Co-authored-by: TheFox0x7 <thefox0x7@gmail.com> Co-committed-by: TheFox0x7 <thefox0x7@gmail.com>
This commit is contained in:
parent
94933470cd
commit
4de909747b
504 changed files with 5028 additions and 4680 deletions
|
@ -22,6 +22,7 @@ import (
|
|||
"code.gitea.io/gitea/tests"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestAPITeam(t *testing.T) {
|
||||
|
@ -119,7 +120,7 @@ func TestAPITeam(t *testing.T) {
|
|||
|
||||
// Read team.
|
||||
teamRead := unittest.AssertExistsAndLoadBean(t, &organization.Team{ID: teamID})
|
||||
assert.NoError(t, teamRead.LoadUnits(db.DefaultContext))
|
||||
require.NoError(t, teamRead.LoadUnits(db.DefaultContext))
|
||||
req = NewRequestf(t, "GET", "/api/v1/teams/%d", teamID).
|
||||
AddTokenAuth(token)
|
||||
resp = MakeRequest(t, req, http.StatusOK)
|
||||
|
@ -195,7 +196,7 @@ func TestAPITeam(t *testing.T) {
|
|||
resp = MakeRequest(t, req, http.StatusOK)
|
||||
apiTeam = api.Team{}
|
||||
DecodeJSON(t, resp, &apiTeam)
|
||||
assert.NoError(t, teamRead.LoadUnits(db.DefaultContext))
|
||||
require.NoError(t, teamRead.LoadUnits(db.DefaultContext))
|
||||
checkTeamResponse(t, "ReadTeam2", &apiTeam, teamRead.Name, *teamToEditDesc.Description, teamRead.IncludesAllRepositories,
|
||||
teamRead.AccessMode.String(), teamRead.GetUnitNames(), teamRead.GetUnitsMap())
|
||||
|
||||
|
@ -257,9 +258,9 @@ func checkTeamResponse(t *testing.T, testName string, apiTeam *api.Team, name, d
|
|||
|
||||
func checkTeamBean(t *testing.T, id int64, name, description string, includesAllRepositories bool, permission string, units []string, unitsMap map[string]string) {
|
||||
team := unittest.AssertExistsAndLoadBean(t, &organization.Team{ID: id})
|
||||
assert.NoError(t, team.LoadUnits(db.DefaultContext), "LoadUnits")
|
||||
require.NoError(t, team.LoadUnits(db.DefaultContext), "LoadUnits")
|
||||
apiTeam, err := convert.ToTeam(db.DefaultContext, team)
|
||||
assert.NoError(t, err)
|
||||
require.NoError(t, err)
|
||||
checkTeamResponse(t, fmt.Sprintf("checkTeamBean/%s_%s", name, description), apiTeam, name, description, includesAllRepositories, permission, units, unitsMap)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue