service_test.go 444 B

12345678910111213141516171819202122232425262728293031
  1. package view
  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_Ping(t *testing.T) {
  22. Convey("Ping", t, func() {
  23. s.Ping(context.TODO())
  24. })
  25. }