You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324
  1. // Copyright 2019 The Gitea Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package git
  5. import (
  6. "path/filepath"
  7. "testing"
  8. "github.com/stretchr/testify/assert"
  9. )
  10. func TestGetNotes(t *testing.T) {
  11. bareRepo1Path := filepath.Join(testReposDir, "repo1_bare")
  12. bareRepo1, err := OpenRepository(bareRepo1Path)
  13. assert.NoError(t, err)
  14. note := Note{}
  15. err = GetNote(bareRepo1, "95bb4d39648ee7e325106df01a621c530863a653", &note)
  16. assert.NoError(t, err)
  17. assert.Equal(t, []byte("Note contents\n"), note.Message)
  18. assert.Equal(t, "Vladimir Panteleev", note.Commit.Author.Name)
  19. }