import_test.go 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. package ugc
  2. import (
  3. "go-common/app/service/main/archive/api"
  4. "testing"
  5. . "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestDao_FinishUpper(t *testing.T) {
  8. Convey("TestDao_FinishUpper", t, WithDao(func(d *Dao) {
  9. err := d.FinishUpper(ctx, 1)
  10. So(err, ShouldBeNil)
  11. }))
  12. }
  13. func TestDao_Import(t *testing.T) {
  14. Convey("TestDao_Import", t, WithDao(func(d *Dao) {
  15. res, err := d.Import(ctx)
  16. So(err, ShouldBeNil)
  17. So(len(res), ShouldBeGreaterThan, 0)
  18. }))
  19. }
  20. func TestDao_PpUpper(t *testing.T) {
  21. Convey("TestDao_PpUpper", t, WithDao(func(d *Dao) {
  22. err := d.PpUpper(ctx, 1)
  23. So(err, ShouldBeNil)
  24. }))
  25. }
  26. func TestDao_BeginTran(t *testing.T) {
  27. Convey("TestDao_BeginTran", t, WithDao(func(d *Dao) {
  28. tx, err := d.BeginTran(ctx)
  29. So(err, ShouldBeNil)
  30. tx.Rollback()
  31. }))
  32. }
  33. func TestDao_FilterExist(t *testing.T) {
  34. Convey("TestDao_FilterExist", t, WithDao(func(d *Dao) {
  35. pMap := make(map[int64]*api.Arc)
  36. pAids := []int64{10106351, 10106309, 10106308, 10106307, 10106306, 10106284, 10105807, 10101484, 10100856, 10100855, 10100486, 10100146, 10100145, 10100144,
  37. 10100044, 10099332, 10099167, 10099150, 10099149, 10098970}
  38. err := d.FilterExist(ctx, &pMap, pAids)
  39. So(err, ShouldBeNil)
  40. }))
  41. }