assist_test.go 633 B

123456789101112131415161718192021222324252627
  1. package danmu
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. gock "gopkg.in/h2non/gock.v1"
  7. )
  8. func TestDanmuResetUpBanned(t *testing.T) {
  9. var (
  10. c = context.TODO()
  11. mid = int64(2089809)
  12. state = int8(0)
  13. hash = "iamahashstring"
  14. ip = "127.0.0.1"
  15. )
  16. convey.Convey("ResetUpBanned", t, func(ctx convey.C) {
  17. defer gock.OffAll()
  18. httpMock("POST", d.assistDmBannedURL).Reply(200).JSON(`{"code":0,"message":"0","ttl":1,"data":""}`)
  19. err := d.ResetUpBanned(c, mid, state, hash, ip)
  20. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  21. ctx.So(err, convey.ShouldBeNil)
  22. })
  23. })
  24. }