2019-11-02 14:32:58 +00:00
|
|
|
package suites
|
|
|
|
|
|
|
|
import (
|
|
|
|
"io/ioutil"
|
|
|
|
"net/http"
|
2019-11-24 20:27:59 +00:00
|
|
|
"testing"
|
2019-11-02 14:32:58 +00:00
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
2019-11-24 20:27:59 +00:00
|
|
|
func doHTTPGetQuery(t *testing.T, url string) []byte {
|
|
|
|
client := NewHTTPClient()
|
2019-11-02 14:32:58 +00:00
|
|
|
req, err := http.NewRequest("GET", url, nil)
|
2019-11-24 20:27:59 +00:00
|
|
|
assert.NoError(t, err)
|
2019-11-02 14:32:58 +00:00
|
|
|
|
|
|
|
req.Header.Add("Accept", "application/json")
|
|
|
|
resp, err := client.Do(req)
|
2019-11-24 20:27:59 +00:00
|
|
|
assert.NoError(t, err)
|
2019-11-02 14:32:58 +00:00
|
|
|
|
|
|
|
defer resp.Body.Close()
|
|
|
|
body, _ := ioutil.ReadAll(resp.Body)
|
2020-05-05 19:35:32 +00:00
|
|
|
|
2019-11-02 14:32:58 +00:00
|
|
|
return body
|
|
|
|
}
|