mirror of
https://gitlab.com/psuapp/psu.git
synced 2024-08-30 18:12:34 +00:00
Add tests for client.NewClient()
This commit is contained in:
parent
a7bfa6e0b0
commit
0f0eaa7c3f
@ -24,6 +24,14 @@ func writeResponseBodyAsJson(w http.ResponseWriter, body map[string]interface{})
|
||||
return
|
||||
}
|
||||
|
||||
func TestNewClient(t *testing.T) {
|
||||
validClient, err := NewClient(http.DefaultClient, Config{
|
||||
Url: "http://validurl.com",
|
||||
})
|
||||
assert.NotNil(t, validClient)
|
||||
assert.Nil(t, err)
|
||||
}
|
||||
|
||||
func TestClientAuthenticates(t *testing.T) {
|
||||
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
|
||||
var body map[string]interface{}
|
||||
|
Loading…
Reference in New Issue
Block a user