mirror of
https://github.com/cubixle/ebay.git
synced 2026-04-24 21:24:47 +01:00
wip integration bidding
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"net/url"
|
||||
"testing"
|
||||
|
||||
"github.com/jybp/ebay"
|
||||
@@ -24,7 +25,7 @@ func TestNewRequest(t *testing.T) {
|
||||
|
||||
func TestCheckResponseNoError(t *testing.T) {
|
||||
resp := &http.Response{StatusCode: 200}
|
||||
assert.Nil(t, ebay.CheckResponse(resp))
|
||||
assert.Nil(t, ebay.CheckResponse(&http.Request{}, resp))
|
||||
}
|
||||
|
||||
func TestCheckResponse(t *testing.T) {
|
||||
@@ -53,7 +54,7 @@ func TestCheckResponse(t *testing.T) {
|
||||
]
|
||||
}`
|
||||
resp := &http.Response{StatusCode: 400, Body: ioutil.NopCloser(bytes.NewBufferString(body))}
|
||||
err, ok := ebay.CheckResponse(resp).(*ebay.ErrorData)
|
||||
err, ok := ebay.CheckResponse(&http.Request{URL: &url.URL{}}, resp).(*ebay.ErrorData)
|
||||
assert.True(t, ok)
|
||||
assert.Equal(t, 1, len(err.Errors))
|
||||
assert.Equal(t, 15008, err.Errors[0].ErrorID)
|
||||
|
||||
Reference in New Issue
Block a user