go-common/app/interface/main/dm2/service/dm_history_test.go
2019-04-22 18:49:16 +08:00

30 lines
707 B
Go

package service
import (
"context"
"testing"
"time"
. "github.com/smartystreets/goconvey/convey"
)
func TestSearchDMHisIndex(t *testing.T) {
Convey("test dm history date index", t, func() {
res, err := svr.SearchDMHisIndex(context.TODO(), 1, 10109227, "2018-04")
So(err, ShouldBeNil)
So(res, ShouldNotBeEmpty)
t.Log(res)
})
}
func TestSearchDMHistory(t *testing.T) {
Convey("", t, func() {
date, _ := time.Parse("2006-01-02", "2018-04-24")
// convert 2006-01-02-->2016-01-02 23:59:59
tm := time.Date(date.Year(), date.Month(), date.Day(), 23, 59, 59, 0, time.Local)
xml, err := svr.SearchDMHistory(context.TODO(), 1, 10109227, tm.Unix())
So(err, ShouldBeNil)
t.Log(xml)
})
}