report_test.go 718 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package report
  2. import (
  3. "context"
  4. "flag"
  5. "path/filepath"
  6. "testing"
  7. "time"
  8. "go-common/app/interface/main/app-view/conf"
  9. . "github.com/smartystreets/goconvey/convey"
  10. )
  11. var (
  12. s *Service
  13. )
  14. func init() {
  15. dir, _ := filepath.Abs("../../cmd/app-view-test.toml")
  16. flag.Set("conf", dir)
  17. conf.Init()
  18. s = New(conf.Conf)
  19. time.Sleep(5 * time.Second)
  20. }
  21. func Test_CopyWriter(t *testing.T) {
  22. Convey("CopyWriter", t, func() {
  23. s.CopyWriter(context.TODO(), 1, 0, "")
  24. })
  25. }
  26. func Test_AddReport(t *testing.T) {
  27. Convey("AddReport", t, func() {
  28. s.AddReport(context.TODO(), 1684013, 1, 0, "", "", "")
  29. })
  30. }
  31. func Test_Upload(t *testing.T) {
  32. Convey("Upload", t, func() {
  33. s.Upload(context.TODO(), "", []byte{})
  34. })
  35. }