Fix broken CI (#602)

closes #599
"blocks" #598

Co-authored-by: Norwin <git@nroo.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/602
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
Reviewed-by: 6543 <6543@obermui.de>
Co-authored-by: Norwin <noerw@noreply.gitea.io>
Co-committed-by: Norwin <noerw@noreply.gitea.io>
This commit is contained in:
Norwin 2022-09-16 01:47:16 +08:00 committed by 6543
parent 5852fcc4a3
commit e5b5b3447a
4 changed files with 9 additions and 4 deletions

View file

@ -2,4 +2,8 @@
// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// Package gitea implements a client for the Gitea API.
// The version corresponds to the highest supported version
// of the gitea API, but backwards-compatibility is mostly
// given.
package gitea // import "code.gitea.io/sdk/gitea" package gitea // import "code.gitea.io/sdk/gitea"

View file

@ -11,11 +11,10 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
) )
/** /*
*
// 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 {}
*/ */
func TestOrgMembership(t *testing.T) { func TestOrgMembership(t *testing.T) {
log.Println("== TestOrgMembership ==") log.Println("== TestOrgMembership ==")

View file

@ -24,6 +24,8 @@ func TestRepoBranches(t *testing.T) {
bl, _, err := c.ListRepoBranches(repo.Owner.UserName, repo.Name, ListRepoBranchesOptions{}) bl, _, err := c.ListRepoBranches(repo.Owner.UserName, repo.Name, ListRepoBranchesOptions{})
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!
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)

View file

@ -57,7 +57,7 @@ func TestRepoMigrateAndLanguages(t *testing.T) {
repoG, _, err := c.GetRepo(repoM.Owner.UserName, repoM.Name) repoG, _, err := c.GetRepo(repoM.Owner.UserName, repoM.Name)
assert.NoError(t, err) assert.NoError(t, err)
assert.EqualValues(t, repoM.ID, repoG.ID) assert.EqualValues(t, repoM.ID, repoG.ID)
assert.EqualValues(t, "master", repoG.DefaultBranch) assert.EqualValues(t, "main", repoG.DefaultBranch)
assert.True(t, repoG.Mirror) assert.True(t, repoG.Mirror)
assert.False(t, repoG.Empty) assert.False(t, repoG.Empty)
assert.EqualValues(t, 1, repoG.Watchers) assert.EqualValues(t, 1, repoG.Watchers)