hbase_test.go 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. package data
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestDatahbaseMd5Key(t *testing.T) {
  8. convey.Convey("hbaseMd5Key", t, func(ctx convey.C) {
  9. var (
  10. aid = int64(0)
  11. )
  12. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  13. p1 := hbaseMd5Key(aid)
  14. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  15. ctx.So(p1, convey.ShouldNotBeNil)
  16. })
  17. })
  18. })
  19. }
  20. func TestDataVideoQuitPoints(t *testing.T) {
  21. convey.Convey("VideoQuitPoints", t, func(ctx convey.C) {
  22. var (
  23. c = context.Background()
  24. cid = int64(0)
  25. )
  26. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  27. res, err := d.VideoQuitPoints(c, cid)
  28. ctx.Convey("Then err should be nil.res should not be nil.", func(ctx convey.C) {
  29. ctx.So(err, convey.ShouldNotBeNil)
  30. ctx.So(res, convey.ShouldBeNil)
  31. })
  32. })
  33. })
  34. }
  35. func TestDataArchiveStat(t *testing.T) {
  36. convey.Convey("ArchiveStat", t, func(ctx convey.C) {
  37. var (
  38. c = context.Background()
  39. aid = int64(0)
  40. )
  41. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  42. stat, err := d.ArchiveStat(c, aid)
  43. ctx.Convey("Then err should be nil.stat should not be nil.", func(ctx convey.C) {
  44. ctx.So(err, convey.ShouldNotBeNil)
  45. ctx.So(stat, convey.ShouldBeNil)
  46. })
  47. })
  48. })
  49. }
  50. func TestDataArchiveArea(t *testing.T) {
  51. convey.Convey("ArchiveArea", t, func(ctx convey.C) {
  52. var (
  53. c = context.Background()
  54. aid = int64(0)
  55. )
  56. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  57. res, err := d.ArchiveArea(c, aid)
  58. ctx.Convey("Then err should be nil.res should not be nil.", func(ctx convey.C) {
  59. ctx.So(err, convey.ShouldNotBeNil)
  60. ctx.So(res, convey.ShouldBeNil)
  61. })
  62. })
  63. })
  64. }
  65. func TestDataBaseUpStat(t *testing.T) {
  66. convey.Convey("BaseUpStat", t, func(ctx convey.C) {
  67. var (
  68. c = context.Background()
  69. mid = int64(0)
  70. date = ""
  71. )
  72. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  73. stat, err := d.BaseUpStat(c, mid, date)
  74. ctx.Convey("Then err should be nil.stat should not be nil.", func(ctx convey.C) {
  75. ctx.So(err, convey.ShouldNotBeNil)
  76. ctx.So(stat, convey.ShouldBeNil)
  77. })
  78. })
  79. })
  80. }