flow_design_test.go 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. package archive
  2. import (
  3. "context"
  4. "testing"
  5. . "github.com/smartystreets/goconvey/convey"
  6. "go-common/app/job/main/videoup-report/model/archive"
  7. )
  8. func TestDao_TxAddFlow(t *testing.T) {
  9. Convey("TxAddFlow", t, func() {
  10. c := context.TODO()
  11. tx, _ := d.BeginTran(c)
  12. fid, err := d.TxAddFlow(tx, archive.PoolArcForbid, 1, 0, archive.FLowGroupIDChannel, "测试添加")
  13. tx.Commit()
  14. So(err, ShouldBeNil)
  15. Println(fid)
  16. })
  17. }
  18. func TestDao_TxAddFlowLog(t *testing.T) {
  19. Convey("TxAddFlowLog", t, func() {
  20. c := context.TODO()
  21. tx, _ := d.BeginTran(c)
  22. id, err := d.TxAddFlowLog(tx, archive.PoolArcForbid, archive.FlowLogAdd, 1, 0, archive.FLowGroupIDChannel, "测试添加")
  23. tx.Commit()
  24. So(err, ShouldBeNil)
  25. Println(id)
  26. })
  27. }
  28. func TestDao_TxUpFlowState(t *testing.T) {
  29. Convey("TxUpFlowState", t, func() {
  30. c := context.TODO()
  31. tx, _ := d.BeginTran(c)
  32. id, err := d.TxUpFlowState(tx, 551, archive.FlowDelete)
  33. tx.Commit()
  34. So(err, ShouldBeNil)
  35. Println(id)
  36. })
  37. }
  38. func TestDao_FlowUnique(t *testing.T) {
  39. Convey("FlowUnique", t, func() {
  40. c := context.TODO()
  41. f, err := d.FlowUnique(c, 1, archive.FLowGroupIDChannel, archive.PoolArcForbid)
  42. So(err, ShouldBeNil)
  43. Println(f)
  44. })
  45. }