Fix broken CI #602

Merged
6543 merged 4 commits from noerw/go-sdk:fix-ci into main 2022-09-15 17:47:17 +00:00
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
// 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"

View File

@ -11,11 +11,10 @@ import (
"github.com/stretchr/testify/assert"
)
/**
/*
*
// DeleteOrgMembership remove a member from an organization
func (c *Client) DeleteOrgMembership(org, user string) error {}
*/
func TestOrgMembership(t *testing.T) {
log.Println("== TestOrgMembership ==")

View File

@ -24,6 +24,8 @@ func TestRepoBranches(t *testing.T) {
bl, _, err := c.ListRepoBranches(repo.Owner.UserName, repo.Name, ListRepoBranchesOptions{})
assert.NoError(t, err)
assert.Len(t, bl, 3)
// FIXME: order of returned branches is not deterministic!
assert.EqualValues(t, "feature", bl[0].Name)
assert.EqualValues(t, "main", bl[1].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)
assert.NoError(t, err)
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.False(t, repoG.Empty)
assert.EqualValues(t, 1, repoG.Watchers)