bangumi_test.go 900 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestDaoBangumiPull(t *testing.T) {
  8. var (
  9. c = context.Background()
  10. mid = int64(2)
  11. ip = ""
  12. )
  13. convey.Convey("BangumiPull", t, func(ctx convey.C) {
  14. seasonIDS, err := d.BangumiPull(c, mid, ip)
  15. ctx.Convey("Then err should be nil.seasonIDS should not be nil.", func(ctx convey.C) {
  16. ctx.So(err, convey.ShouldBeNil)
  17. ctx.So(seasonIDS, convey.ShouldBeNil)
  18. })
  19. })
  20. }
  21. func TestDaoBangumiSeasons(t *testing.T) {
  22. var (
  23. c = context.Background()
  24. seasonIDs = []int64{5735, 5714, 5702, 5725}
  25. ip = ""
  26. )
  27. convey.Convey("BangumiSeasons", t, func(ctx convey.C) {
  28. psm, err := d.BangumiSeasons(c, seasonIDs, ip)
  29. ctx.Convey("Then err should be nil.psm should not be nil.", func(ctx convey.C) {
  30. ctx.So(err, convey.ShouldBeNil)
  31. ctx.So(psm, convey.ShouldNotBeNil)
  32. })
  33. })
  34. }