2020-02-09 01:08:43 +00:00
|
|
|
// Copyright 2020 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 (
|
|
|
|
"log"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestListRepoCommits(t *testing.T) {
|
|
|
|
log.Println("== TestListRepoCommits ==")
|
|
|
|
c := newTestClient()
|
|
|
|
|
|
|
|
repo, err := createTestRepo(t, "ListRepoCommits", c)
|
|
|
|
assert.NoError(t, err)
|
|
|
|
|
2020-09-14 03:37:09 +01:00
|
|
|
l, _, err := c.ListRepoCommits(repo.Owner.UserName, repo.Name, ListCommitOptions{})
|
2020-02-09 01:08:43 +00:00
|
|
|
assert.NoError(t, err)
|
|
|
|
assert.Len(t, l, 1)
|
2020-07-08 18:21:40 +01:00
|
|
|
assert.EqualValues(t, "Initial commit\n", l[0].RepoCommit.Message)
|
2022-04-28 11:58:54 +01:00
|
|
|
assert.EqualValues(t, "gpg.error.not_signed_commit", l[0].RepoCommit.Verification.Reason)
|
|
|
|
assert.EqualValues(t, 100, l[0].Stats.Additions)
|
2020-02-09 01:08:43 +00:00
|
|
|
}
|