history_test.go 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package service
  2. import (
  3. "context"
  4. "github.com/smartystreets/goconvey/convey"
  5. "testing"
  6. )
  7. func Test_trackArchiveInfo(t *testing.T) {
  8. convey.Convey("稿件编辑历史和track信息合并", t, WithService(func(s *Service) {
  9. c := context.TODO()
  10. aid := int64(1)
  11. inf, err := s.TrackArchiveInfo(c, aid)
  12. convey.So(err, convey.ShouldBeNil)
  13. convey.So(len(inf.Relation), convey.ShouldBeGreaterThanOrEqualTo, len(inf.EditHistory))
  14. for k, it := range inf.Relation {
  15. t.Logf("relation k(%d) it(%v)", k, it)
  16. }
  17. t.Logf("tr len(%d)", len(inf.Track))
  18. }))
  19. }
  20. func Test_editHistory(t *testing.T) {
  21. convey.Convey("hid获取稿件+分P编辑历史", t, WithService(func(s *Service) {
  22. c := context.TODO()
  23. hid := int64(1)
  24. _, err := s.EditHistory(c, hid)
  25. convey.So(err, convey.ShouldBeNil)
  26. }))
  27. }
  28. func Test_allEditHistory(t *testing.T) {
  29. convey.Convey("稿件编辑历史和track信息合并", t, WithService(func(s *Service) {
  30. c := context.TODO()
  31. aid := int64(10107879)
  32. h, err := s.AllEditHistory(c, aid)
  33. for _, o := range h {
  34. t.Logf("ah(%+v) vh(%+v)", o.ArcHistory, o.VHistory)
  35. }
  36. convey.So(err, convey.ShouldBeNil)
  37. }))
  38. }