Files
EdgeAPI/internal/db/models/http_access_log_dao_test.go

31 lines
575 B
Go
Raw Normal View History

2020-10-10 11:49:21 +08:00
package models
import (
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
_ "github.com/go-sql-driver/mysql"
_ "github.com/iwind/TeaGo/bootstrap"
"testing"
"time"
)
func TestCreateHTTPAccessLogs(t *testing.T) {
err := NewDBNodeInitializer().loop()
if err != nil {
t.Fatal(err)
}
accessLog := &pb.HTTPAccessLog{
ServerId: 1,
NodeId: 4,
Status: 200,
Timestamp: time.Now().Unix(),
}
dao := randomAccessLogDAO()
t.Log("dao:", dao)
err = CreateHTTPAccessLogsWithDAO(dao, []*pb.HTTPAccessLog{accessLog})
if err != nil {
t.Fatal(err)
}
t.Log("ok")
}