author_test.go 423 B

123456789101112131415161718192021
  1. package service
  2. import (
  3. "context"
  4. "testing"
  5. "time"
  6. . "github.com/smartystreets/goconvey/convey"
  7. )
  8. func Test_UpdateAuthorCache(t *testing.T) {
  9. mid := int64(99999999)
  10. Convey("add author", t, WithCleanCache(func() {
  11. //load data
  12. err := s.UpdateAuthorCache(context.TODO(), mid)
  13. So(err, ShouldBeNil)
  14. time.Sleep(time.Millisecond * 100)
  15. ok, _, _ := s.IsAuthor(context.TODO(), mid)
  16. So(ok, ShouldBeTrue)
  17. }))
  18. }