Skip to content

Commit

Permalink
Catch error in testing
Browse files Browse the repository at this point in the history
  • Loading branch information
axllent committed Aug 18, 2022
1 parent 40cb768 commit 3054dfe
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions storage/database_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,19 @@ RepeatTest:
assertEqual(t, msg.Attachments[0].FileName, "Sample PDF.pdf", "attachment filename does not match")
assertEqual(t, len(msg.Inline), 1, "incorrect number of inline attachments")
assertEqual(t, msg.Inline[0].FileName, "inline-image.jpg", "inline attachment filename does not match")

attachmentData, err := GetAttachmentPart(DefaultMailbox, id, msg.Attachments[0].PartID)
if err != nil {
t.Log("error ", err)
t.Fail()
}
assertEqual(t, len(attachmentData.Content), msg.Attachments[0].Size, "attachment size does not match")

inlineData, err := GetAttachmentPart(DefaultMailbox, id, msg.Inline[0].PartID)
if err != nil {
t.Log("error ", err)
t.Fail()
}
assertEqual(t, len(inlineData.Content), msg.Inline[0].Size, "inline attachment size does not match")

db.Close()
Expand Down

0 comments on commit 3054dfe

Please sign in to comment.