summaryrefslogtreecommitdiffstats
path: root/models/attachment_test.go
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2021-06-07 07:27:09 +0200
committerGitHub <noreply@github.com>2021-06-07 07:27:09 +0200
commit3607f79d7869046d919fed05a21b55b6e61df1fa (patch)
tree9a176a4d5b67ac3a81ae210e9164d81959221ce0 /models/attachment_test.go
parent51775f65bc933843199320b040186703a2bb9f51 (diff)
downloadgitea-3607f79d7869046d919fed05a21b55b6e61df1fa.tar.gz
gitea-3607f79d7869046d919fed05a21b55b6e61df1fa.zip
Fixed assert statements. (#16089)
Diffstat (limited to 'models/attachment_test.go')
-rw-r--r--models/attachment_test.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/models/attachment_test.go b/models/attachment_test.go
index fa7fd3471b..700b7c09db 100644
--- a/models/attachment_test.go
+++ b/models/attachment_test.go
@@ -61,11 +61,11 @@ func TestGetByCommentOrIssueID(t *testing.T) {
// count of attachments from issue ID
attachments, err := GetAttachmentsByIssueID(1)
assert.NoError(t, err)
- assert.Equal(t, 1, len(attachments))
+ assert.Len(t, attachments, 1)
attachments, err = GetAttachmentsByCommentID(1)
assert.NoError(t, err)
- assert.Equal(t, 2, len(attachments))
+ assert.Len(t, attachments, 2)
}
func TestDeleteAttachments(t *testing.T) {
@@ -122,7 +122,7 @@ func TestGetAttachmentsByUUIDs(t *testing.T) {
attachList, err := GetAttachmentsByUUIDs(DefaultDBContext(), []string{"a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11", "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a17", "not-existing-uuid"})
assert.NoError(t, err)
- assert.Equal(t, 2, len(attachList))
+ assert.Len(t, attachList, 2)
assert.Equal(t, "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11", attachList[0].UUID)
assert.Equal(t, "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a17", attachList[1].UUID)
assert.Equal(t, int64(1), attachList[0].IssueID)