httpClient_test.go 450 B

12345678910111213141516171819202122
  1. package service
  2. import (
  3. "testing"
  4. "time"
  5. . "github.com/smartystreets/goconvey/convey"
  6. )
  7. func Test_HTTPClient(t *testing.T) {
  8. Convey("growup-job HttpClient", t, WithService(func(s *Service) {
  9. var (
  10. method = "GET"
  11. url = ""
  12. params = make(map[string]string)
  13. nowTime = time.Now().Add(-24 * time.Hour).Unix()
  14. )
  15. res, err := s.HTTPClient(method, url, params, nowTime)
  16. So(err, ShouldBeNil)
  17. So(res, ShouldNotBeEmpty)
  18. }))
  19. }