dm_seg_test.go 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. package service
  2. import (
  3. "context"
  4. "testing"
  5. "go-common/app/interface/main/dm2/model"
  6. . "github.com/smartystreets/goconvey/convey"
  7. )
  8. func TestDmNormalIds(t *testing.T) {
  9. var (
  10. tp int32 = 1
  11. oid int64 = 19
  12. cnt int64 = 1
  13. n int64 = 2
  14. ps int64
  15. pe int64 = 1000
  16. limit int64 = 100
  17. )
  18. Convey("test edit dm state", t, func() {
  19. dmids, err := svr.dmNormalIds(context.Background(), tp, oid, cnt, n, ps, pe, limit)
  20. So(err, ShouldBeNil)
  21. So(dmids, ShouldNotBeNil)
  22. })
  23. }
  24. func TestSegmentInfo(t *testing.T) {
  25. var (
  26. tp int32 = 1
  27. aid int64 = 10097265
  28. oid int64 = 1508
  29. ps int64 = 10
  30. c = context.TODO()
  31. seg *model.Segment
  32. err error
  33. )
  34. if seg, err = svr.segmentInfo(c, tp, aid, oid, ps); err != nil {
  35. t.Fatalf("s.segmentInfo(%d, %d) error(%v)", aid, oid, err)
  36. }
  37. t.Logf("aid:%d, oid:%d, segment:%+v", aid, oid, seg)
  38. }
  39. func TestService_JudgeDMList(t *testing.T) {
  40. var (
  41. cid, dmid int64 = 9967369, 719232849
  42. )
  43. dm, err := svr.JudgeDms(context.TODO(), 1, cid, dmid)
  44. if err != nil {
  45. t.Fatal(err)
  46. }
  47. for _, m := range dm.List {
  48. t.Logf("%v", m)
  49. }
  50. }