git-lfs/api/http_response_test.go
2016-05-24 09:27:15 -06:00

28 lines
673 B
Go

package api_test
import (
"bytes"
"io/ioutil"
"net/http"
"testing"
"github.com/github/git-lfs/api"
"github.com/github/git-lfs/vendor/_nuts/github.com/technoweenie/assert"
)
func TestWrappedHttpResponsesMatchInternal(t *testing.T) {
resp := &http.Response{
Status: "200 OK",
StatusCode: 200,
Proto: "HTTP/1.1",
Body: ioutil.NopCloser(new(bytes.Buffer)),
}
wrapped := api.WrapHttpResponse(resp)
assert.Equal(t, resp.Status, wrapped.Status())
assert.Equal(t, resp.StatusCode, wrapped.StatusCode())
assert.Equal(t, resp.Proto, wrapped.Proto())
assert.Equal(t, resp.Body, wrapped.Body())
assert.Equal(t, resp.Header, wrapped.Header())
}