hbase_test.go 904 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "time"
  6. "github.com/smartystreets/goconvey/convey"
  7. )
  8. func TestDaohbaseMd5Key(t *testing.T) {
  9. convey.Convey("hbaseMd5Key", t, func(ctx convey.C) {
  10. var (
  11. aid = int64(1)
  12. )
  13. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  14. p1 := hbaseMd5Key(aid)
  15. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  16. ctx.So(p1, convey.ShouldNotBeNil)
  17. })
  18. })
  19. })
  20. }
  21. func TestDaoArchiveStat(t *testing.T) {
  22. convey.Convey("ArchiveStat", t, func(ctx convey.C) {
  23. var (
  24. c = context.Background()
  25. aid = int64(2)
  26. date = time.Now()
  27. )
  28. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  29. stat, err := d.ArchiveStat(c, aid, date)
  30. ctx.Convey("Then err should not be nil.stat should be nil.", func(ctx convey.C) {
  31. ctx.So(err, convey.ShouldNotBeNil)
  32. ctx.So(stat, convey.ShouldBeNil)
  33. })
  34. })
  35. })
  36. }