Round 4
Signed-off-by: Doug Davis <dug@us.ibm.com>
This commit is contained in:
parent
b8b16b78f4
commit
56349665b7
13 changed files with 334 additions and 197 deletions
|
@ -780,11 +780,15 @@ func checkBodyHasErrorCodes(t *testing.T, msg string, resp *http.Response, error
|
|||
counts[code] = 0
|
||||
}
|
||||
|
||||
for _, err := range errs {
|
||||
if _, ok := expected[err.Code]; !ok {
|
||||
t.Fatalf("unexpected error code %v encountered during %s: %s ", err.Code, msg, string(p))
|
||||
for _, e := range errs {
|
||||
err, ok := e.(errcode.ErrorCoder)
|
||||
if !ok {
|
||||
t.Fatalf("not an ErrorCoder: %#v", e)
|
||||
}
|
||||
counts[err.Code]++
|
||||
if _, ok := expected[err.ErrorCode()]; !ok {
|
||||
t.Fatalf("unexpected error code %v encountered during %s: %s ", err.ErrorCode(), msg, string(p))
|
||||
}
|
||||
counts[err.ErrorCode()]++
|
||||
}
|
||||
|
||||
// Ensure that counts of expected errors were all non-zero
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue