diff options
Diffstat (limited to 'modules/git/notes_test.go')
-rw-r--r-- | modules/git/notes_test.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/modules/git/notes_test.go b/modules/git/notes_test.go index f66a191e6a..fec46e5960 100644 --- a/modules/git/notes_test.go +++ b/modules/git/notes_test.go @@ -39,3 +39,15 @@ func TestGetNestedNotes(t *testing.T) { assert.NoError(t, err) assert.Equal(t, []byte("Note 1"), note.Message) } + +func TestGetNonExistentNotes(t *testing.T) { + bareRepo1Path := filepath.Join(testReposDir, "repo1_bare") + bareRepo1, err := OpenRepository(bareRepo1Path) + assert.NoError(t, err) + defer bareRepo1.Close() + + note := Note{} + err = GetNote(context.Background(), bareRepo1, "non_existent_sha", ¬e) + assert.Error(t, err) + assert.IsType(t, ErrNotExist{}, err) +} |