memcache_seg_test.go 800 B

1234567891011121314151617181920212223242526272829303132333435
  1. package dao
  2. import (
  3. "testing"
  4. "go-common/app/job/main/dm2/model"
  5. . "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestDelXMLSegCache(t *testing.T) {
  8. Convey("check delete segment xml cache,error should be nil", t, func() {
  9. err := testDao.DelXMLSegCache(c, 1, 1221, 1, 1)
  10. So(err, ShouldBeNil)
  11. })
  12. }
  13. func TestSetDMSegCache(t *testing.T) {
  14. Convey("set dm segment cache, error should be nil", t, func() {
  15. dmseg := new(model.DMSeg)
  16. dmseg.Elems = append(dmseg.Elems, &model.Elem{Content: "dm msg"})
  17. err := testDao.SetDMSegCache(c, 1, 1221, 1, 1, dmseg)
  18. So(err, ShouldBeNil)
  19. })
  20. }
  21. func TestDMSegCache(t *testing.T) {
  22. Convey("get dm segment cache", t, func() {
  23. dmseg, err := testDao.DMSegCache(c, 1, 1221, 1, 1)
  24. if err != nil {
  25. t.Fatal(err)
  26. }
  27. t.Logf("%+v", dmseg)
  28. })
  29. }