cache_test.go 790 B

123456789101112131415161718192021222324252627282930313233343536
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestDaoTokenPBCache(t *testing.T) {
  8. var (
  9. c = context.TODO()
  10. key = "123456"
  11. )
  12. convey.Convey("TokenPBCache", t, func(ctx convey.C) {
  13. res, err := d.TokenPBCache(c, key)
  14. ctx.Convey("Then err should be nil.res should not be nil.", func(ctx convey.C) {
  15. ctx.So(err, convey.ShouldNotBeNil)
  16. ctx.So(res, convey.ShouldBeNil)
  17. })
  18. })
  19. }
  20. func TestDaoInfoPBCache(t *testing.T) {
  21. var (
  22. c = context.TODO()
  23. key = "123456"
  24. )
  25. convey.Convey("InfoPBCache", t, func(ctx convey.C) {
  26. res, err := d.InfoPBCache(c, key)
  27. ctx.Convey("Then err should be nil.res should not be nil.", func(ctx convey.C) {
  28. ctx.So(err, convey.ShouldNotBeNil)
  29. ctx.So(res, convey.ShouldBeNil)
  30. })
  31. })
  32. }