go-common/app/interface/main/dm2/service/dm_history_test.go

30 lines
707 B
Go
Raw Normal View History

2019-04-22 10:49:16 +00:00
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)
})
}