img_test.go 667 B

12345678910111213141516171819202122232425262728293031
  1. package service
  2. import (
  3. "context"
  4. "testing"
  5. "go-common/app/admin/main/answer/model"
  6. "go-common/library/xstr"
  7. . "github.com/smartystreets/goconvey/convey"
  8. )
  9. func TestServiceImg(t *testing.T) {
  10. Convey("TestServiceImg", t, func() {
  11. ids, err := xstr.SplitInts("35")
  12. s.CreateBFSImg(context.TODO(), ids)
  13. So(err, ShouldBeNil)
  14. })
  15. }
  16. // go test -test.v -test.run TestAddImg
  17. func TestAddImg(t *testing.T) {
  18. q := &model.QuestionDB{ID: 1, State: 1, Question: "test2333"}
  19. Convey("TestAddImgQuestionAdd", t, func() {
  20. err := s.QuestionAdd(context.TODO(), q)
  21. So(err, ShouldBeNil)
  22. })
  23. Convey("TestAddImg", t, func() {
  24. s.GenerateImage(context.TODO())
  25. })
  26. }