Smail/server/pop3_server/action_test.go
jinnrry 096b4b8fed v2.4.3 (#5)
插件迭代、收信规则bug修复
修复邮箱地址解析错误
修改pop删除命令为软删除
升级所有依赖
2024-04-13 08:55:03 +08:00

54 lines
1.0 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package pop3_server
import (
"fmt"
"github.com/Jinnrry/gopop"
log "github.com/sirupsen/logrus"
"os"
"pmail/config"
"pmail/db"
parsemail2 "pmail/dto/parsemail"
"pmail/hooks"
"pmail/session"
"pmail/utils/context"
"testing"
"time"
)
func testInit() {
// 设置日志格式为json格式
//log.SetFormatter(&log.JSONFormatter{})
log.SetReportCaller(true)
log.SetFormatter(&log.TextFormatter{
//以下设置只是为了使输出更美观
DisableColors: true,
TimestampFormat: "2006-01-02 15:03:04",
})
// 设置将日志输出到标准输出(默认的输出为stderr,标准错误)
// 日志消息输出可以是任意的io.writer类型
log.SetOutput(os.Stdout)
// 设置日志级别为warn以上
log.SetLevel(log.TraceLevel)
var cst, _ = time.LoadLocation("Asia/Shanghai")
time.Local = cst
config.Init()
parsemail2.Init()
db.Init()
session.Init()
hooks.Init("dev")
}
func Test_action_Stat(t *testing.T) {
testInit()
act := action{}
v1, v2, v3 := act.Stat(&gopop.Session{
Ctx: &context.Context{},
})
fmt.Println(v1, v2, v3)
}