Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Jinnrry committed Nov 3, 2024
1 parent 4d464b0 commit c9253c1
Showing 1 changed file with 53 additions and 53 deletions.
106 changes: 53 additions & 53 deletions server/pop3_server/action_test.go
Original file line number Diff line number Diff line change
@@ -1,55 +1,55 @@
package pop3_server

import (
"bytes"
"fmt"
"github.com/Jinnrry/gopop"
"github.com/Jinnrry/pmail/config"
"github.com/Jinnrry/pmail/db"
"github.com/Jinnrry/pmail/utils/context"
"github.com/emersion/go-message/mail"
"io"
"testing"
)

func Test_action_Retr(t *testing.T) {
config.Init()
db.Init("")

a := action{}
session := &gopop.Session{
Ctx: &context.Context{
UserID: 1,
},
}
got, got1, err := a.Retr(session, 301)

_, _, _ = got, got1, err
}

func Test_email(t *testing.T) {
var b bytes.Buffer

// Create our mail header
var h mail.Header

// Create a new mail writer
mw, _ := mail.CreateWriter(&b, h)

// Create a text part
tw, _ := mw.CreateInline()

var html mail.InlineHeader

html.Header.Set("Content-Transfer-Encoding", "base64")
w, _ := tw.CreatePart(html)

io.WriteString(w, "=")

w.Close()

tw.Close()

fmt.Printf("%s", b.String())

}
//import (
// "bytes"
// "fmt"
// "github.com/Jinnrry/gopop"
// "github.com/Jinnrry/pmail/config"
// "github.com/Jinnrry/pmail/db"
// "github.com/Jinnrry/pmail/utils/context"
// "github.com/emersion/go-message/mail"
// "io"
// "testing"
//)
//
//func Test_action_Retr(t *testing.T) {
// config.Init()
// db.Init("")
//
// a := action{}
// session := &gopop.Session{
// Ctx: &context.Context{
// UserID: 1,
// },
// }
// got, got1, err := a.Retr(session, 301)
//
// _, _, _ = got, got1, err
//}
//
//func Test_email(t *testing.T) {
// var b bytes.Buffer
//
// // Create our mail header
// var h mail.Header
//
// // Create a new mail writer
// mw, _ := mail.CreateWriter(&b, h)
//
// // Create a text part
// tw, _ := mw.CreateInline()
//
// var html mail.InlineHeader
//
// html.Header.Set("Content-Transfer-Encoding", "base64")
// w, _ := tw.CreatePart(html)
//
// io.WriteString(w, "=")
//
// w.Close()
//
// tw.Close()
//
// fmt.Printf("%s", b.String())
//
//}

0 comments on commit c9253c1

Please sign in to comment.