service_test.go 579 B

1234567891011121314151617181920212223242526272829303132333435
  1. package income
  2. import (
  3. "context"
  4. "flag"
  5. "path/filepath"
  6. "testing"
  7. "go-common/app/job/main/growup/conf"
  8. "go-common/app/job/main/growup/service/ctrl"
  9. . "github.com/smartystreets/goconvey/convey"
  10. )
  11. var (
  12. s *Service
  13. charge *AvChargeSvr
  14. )
  15. func init() {
  16. dir, _ := filepath.Abs("../../cmd/growup-job.toml")
  17. flag.Set("conf", dir)
  18. conf.Init()
  19. if s == nil {
  20. s = New(conf.Conf, ctrl.NewUnboundedExecutor())
  21. }
  22. charge = s.avCharge
  23. }
  24. func TestPing(t *testing.T) {
  25. Convey("Test_Ping", t, func() {
  26. err := s.Ping(context.Background())
  27. So(err, ShouldBeNil)
  28. })
  29. }