Better tests (check that response match the structure) (#52)
Trailing zeros were removed from time in responses because of json marshaling features
This commit is contained in:
@@ -29,7 +29,6 @@ func TestListCertifiedBrands(t *testing.T) {
|
||||
"result": {
|
||||
"brand_certification": [
|
||||
{
|
||||
"brand_id": 135476863,
|
||||
"brand_name": "Sea of Spa",
|
||||
"has_certificate": false
|
||||
}
|
||||
@@ -57,8 +56,11 @@ func TestListCertifiedBrands(t *testing.T) {
|
||||
resp, err := c.Brands().List(ctx, test.params)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
continue
|
||||
}
|
||||
|
||||
compareJsonResponse(t, test.response, &ListCertifiedBrandsResponse{})
|
||||
|
||||
if resp.StatusCode != test.statusCode {
|
||||
t.Errorf("got wrong status code: got: %d, expected: %d", resp.StatusCode, test.statusCode)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user