package service import ( "fmt" "testing" ) func TestAttachmentExtAllowedLogic(t *testing.T) { // Normalize + default list contains msi/html found := false for _, e := range DefaultAttachmentExts { if e == "msi" { found = true break } } if !found { t.Fatal("default list should include msi") } } func TestMimeForAttachmentExt(t *testing.T) { if MimeForAttachmentExt(".pdf") == "application/octet-stream" { t.Fatal("pdf should have real mime") } if MimeForAttachmentExt(".html") != "application/octet-stream" { t.Fatal("html should be octet-stream") } } func TestFileMaxBytesDefault(t *testing.T) { if FileMaxBytes != 20<<20 { t.Fatalf("default FileMaxBytes=%d", FileMaxBytes) } _ = fmt.Sprintf("%d", DefaultAttachmentMaxMB) }