More integration test fixes (#604)

This commit is contained in:
6543 2022-09-16 02:26:31 +08:00
parent e5b5b3447a
commit 7aeaaa45e1
3 changed files with 7 additions and 5 deletions

View file

@ -12,7 +12,6 @@ import (
) )
/* /*
*
// DeleteOrgMembership remove a member from an organization // DeleteOrgMembership remove a member from an organization
func (c *Client) DeleteOrgMembership(org, user string) error {} func (c *Client) DeleteOrgMembership(org, user string) error {}
*/ */

View file

@ -50,7 +50,7 @@ func TestTeamSearch(t *testing.T) {
Query: "Admins", Query: "Admins",
}) })
assert.NoError(t, err) assert.NoError(t, err)
assert.Len(t, teams, 1) if assert.Len(t, teams, 1) {
assert.Equal(t, "Admins", teams[0].Name) assert.Equal(t, "Admins", teams[0].Name)
}
} }

View file

@ -6,6 +6,7 @@ package gitea
import ( import (
"log" "log"
"sort"
"testing" "testing"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
@ -25,7 +26,9 @@ func TestRepoBranches(t *testing.T) {
assert.NoError(t, err) assert.NoError(t, err)
assert.Len(t, bl, 3) assert.Len(t, bl, 3)
// FIXME: order of returned branches is not deterministic! sort.Slice(bl, func(i, j int) bool {
return bl[i].Name < bl[j].Name
})
assert.EqualValues(t, "feature", bl[0].Name) assert.EqualValues(t, "feature", bl[0].Name)
assert.EqualValues(t, "main", bl[1].Name) assert.EqualValues(t, "main", bl[1].Name)
assert.EqualValues(t, "update", bl[2].Name) assert.EqualValues(t, "update", bl[2].Name)