archive_test.go 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. package archive
  2. import (
  3. "context"
  4. "testing"
  5. arccli "go-common/app/service/main/archive/api"
  6. "github.com/smartystreets/goconvey/convey"
  7. )
  8. func TestArchivekeyArc(t *testing.T) {
  9. var (
  10. aid = int64(0)
  11. )
  12. convey.Convey("keyArc", t, func(ctx convey.C) {
  13. p1 := keyArc(aid)
  14. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  15. ctx.So(p1, convey.ShouldNotBeNil)
  16. })
  17. })
  18. }
  19. func TestArchivekeyView(t *testing.T) {
  20. var (
  21. aid = int64(0)
  22. )
  23. convey.Convey("keyView", t, func(ctx convey.C) {
  24. p1 := keyView(aid)
  25. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  26. ctx.So(p1, convey.ShouldNotBeNil)
  27. })
  28. })
  29. }
  30. func TestArchiveUpArcCache(t *testing.T) {
  31. var (
  32. c = context.Background()
  33. a = &arccli.Arc{}
  34. )
  35. convey.Convey("UpArcCache", t, func(ctx convey.C) {
  36. err := d.UpArcCache(c, a)
  37. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  38. ctx.So(err, convey.ShouldBeNil)
  39. })
  40. })
  41. }
  42. func TestArchiveUpViewCache(t *testing.T) {
  43. var (
  44. c = context.Background()
  45. v = &arccli.ViewReply{
  46. Arc: &arccli.Arc{
  47. Aid: 123,
  48. },
  49. }
  50. )
  51. convey.Convey("UpViewCache", t, func(ctx convey.C) {
  52. err := d.UpViewCache(c, v)
  53. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  54. ctx.So(err, convey.ShouldBeNil)
  55. })
  56. })
  57. }