Add CheckCompatibility and GetItemByGroupID

This commit is contained in:
JBP
2019-08-18 19:08:21 +02:00
parent 7484ba3df6
commit 345ff16666
7 changed files with 236 additions and 48 deletions

View File

@@ -38,7 +38,7 @@ func TestNewRequest(t *testing.T) {
func TestCheckResponseNoError(t *testing.T) {
resp := &http.Response{StatusCode: 200}
assert.Nil(t, ebay.CheckResponse(&http.Request{}, resp))
assert.Nil(t, ebay.CheckResponse(&http.Request{}, resp, ""))
}
func TestCheckResponse(t *testing.T) {
@@ -67,7 +67,7 @@ func TestCheckResponse(t *testing.T) {
]
}`
resp := &http.Response{StatusCode: 400, Body: ioutil.NopCloser(bytes.NewBufferString(body))}
err, ok := ebay.CheckResponse(&http.Request{URL: &url.URL{}}, 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)