1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-17 17:47:03 +00:00
Files
go-inbucket/app/inbucket/mime_test.go
James Hillyerd 46b123606b Started work on MIME parser
I'm hoping to mostly rely on the official mime and mime/multipart
packages, but Inbucket is still going to have to decided what to
do with the various parts it reads.
2012-10-14 23:11:39 -07:00

29 lines
554 B
Go

package inbucket
import (
"bufio"
"net/mail"
"os"
"testing"
)
func TestSomething(t *testing.T) {
// Open test email for parsing
raw, err := os.Open("../../test-data/html-mime-attach.raw")
if err != nil {
t.Fatalf("Failed to open test data: %v", err)
}
// Parse email into a mail.Message object like we do
reader := bufio.NewReader(raw)
msg, err := mail.ReadMessage(reader)
if err != nil {
t.Fatalf("Failed to read message: %v", err)
}
_, err = ParseMIMEMessage(msg)
if err != nil {
t.Fatalf("Failed to parse mime: %v", err)
}
}