lic_test.go 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. package lic
  2. import (
  3. model "go-common/app/job/main/tv/model/pgc"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestLicBuildLic(t *testing.T) {
  8. var (
  9. sign = ""
  10. ps = []*model.PS{}
  11. count = int(0)
  12. )
  13. convey.Convey("BuildLic", t, func(ctx convey.C) {
  14. p1 := BuildLic(sign, ps, count)
  15. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  16. ctx.So(p1, convey.ShouldNotBeNil)
  17. })
  18. })
  19. }
  20. func TestLicRandStringBytesRmndr(t *testing.T) {
  21. var (
  22. n = int(0)
  23. )
  24. convey.Convey("RandStringBytesRmndr", t, func(ctx convey.C) {
  25. p1 := RandStringBytesRmndr(n)
  26. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  27. ctx.So(p1, convey.ShouldNotBeNil)
  28. })
  29. })
  30. }
  31. func TestLicDelLic(t *testing.T) {
  32. var (
  33. sign = ""
  34. prefix = ""
  35. sid = int64(0)
  36. )
  37. convey.Convey("DelLic", t, func(ctx convey.C) {
  38. p1 := DelLic(sign, prefix, sid)
  39. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  40. ctx.So(p1, convey.ShouldNotBeNil)
  41. })
  42. })
  43. }
  44. func TestLicDelEpLic(t *testing.T) {
  45. var (
  46. prefix = ""
  47. sign = ""
  48. delEps = []int{}
  49. )
  50. convey.Convey("DelEpLic", t, func(ctx convey.C) {
  51. p1 := DelEpLic(prefix, sign, delEps)
  52. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  53. ctx.So(p1, convey.ShouldNotBeNil)
  54. })
  55. })
  56. }