hbase_test.go 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package dao
  2. import (
  3. "context"
  4. "go-common/app/interface/live/push-live/model"
  5. "testing"
  6. . "github.com/smartystreets/goconvey/convey"
  7. )
  8. func Test_fans1(t *testing.T) {
  9. initd()
  10. Convey("Parse Json To Struct", t, func() {
  11. fan := int64(27515316)
  12. f, fsp1, err := d.Fans(context.TODO(), fan, model.RelationAttention)
  13. t.Logf("the included(%v) includedSP(%v) err(%v)", f, fsp1, err)
  14. f, fsp2, err := d.Fans(context.TODO(), fan, model.RelationSpecial)
  15. t.Logf("the included(%v) includedSP(%v) err(%v)", f, fsp2, err)
  16. f, fsp3, err := d.Fans(context.TODO(), fan, model.RelationAll)
  17. t.Logf("the included(%v) includedSP(%v) err(%v)", f, fsp3, err)
  18. So(len(fsp1)+len(fsp2), ShouldEqual, len(fsp3))
  19. })
  20. }
  21. func Test_fans2(t *testing.T) {
  22. initd()
  23. Convey("Parse Json To Struct", t, func() {
  24. upper := int64(27515316)
  25. fans := make(map[int64]bool)
  26. fans[1232032] = true
  27. fans[21231134] = true
  28. fans[27515398] = true
  29. fans[27515275] = true
  30. f1, f2, err := d.SeparateFans(context.TODO(), upper, fans)
  31. t.Logf("the included(%v) includedSP(%v) err(%v)", f1, f2, err)
  32. So(0, ShouldEqual, 0)
  33. })
  34. }