memcache_test.go 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestDaopingMC(t *testing.T) {
  8. var (
  9. c = context.Background()
  10. )
  11. convey.Convey("pingMC", t, func(ctx convey.C) {
  12. err := d.pingMC(c)
  13. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  14. ctx.So(err, convey.ShouldBeNil)
  15. })
  16. })
  17. }
  18. func TestDaoSetRegionCache(t *testing.T) {
  19. var (
  20. c = context.Background()
  21. regionArcs map[int32][]int64
  22. )
  23. convey.Convey("SetRegionCache", t, func(ctx convey.C) {
  24. err := d.SetRegionCache(c, regionArcs)
  25. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  26. ctx.So(err, convey.ShouldBeNil)
  27. })
  28. })
  29. }
  30. func TestDaoRegionCache(t *testing.T) {
  31. var (
  32. c = context.Background()
  33. )
  34. convey.Convey("RegionCache", t, func(ctx convey.C) {
  35. rs := d.RegionCache(c)
  36. ctx.Convey("Then rs should not be nil.", func(ctx convey.C) {
  37. ctx.So(rs, convey.ShouldNotBeNil)
  38. })
  39. })
  40. }
  41. func TestDaoSetTagCache(t *testing.T) {
  42. var (
  43. c = context.Background()
  44. regionTagArcs map[string][]int64
  45. )
  46. convey.Convey("SetTagCache", t, func(ctx convey.C) {
  47. err := d.SetTagCache(c, regionTagArcs)
  48. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  49. ctx.So(err, convey.ShouldBeNil)
  50. })
  51. })
  52. }
  53. func TestDaoTagCache(t *testing.T) {
  54. var (
  55. c = context.Background()
  56. )
  57. convey.Convey("TagCache", t, func(ctx convey.C) {
  58. rs := d.TagCache(c)
  59. ctx.Convey("Then rs should not be nil.", func(ctx convey.C) {
  60. ctx.So(rs, convey.ShouldNotBeNil)
  61. })
  62. })
  63. }