Skip to content

Commit

Permalink
add a test case for handleErrorResp func (#343)
Browse files Browse the repository at this point in the history
  • Loading branch information
vvatanabe committed Jun 8, 2023
1 parent a412102 commit fe1edcd
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,15 @@ func TestHandleErrorResp(t *testing.T) {
}`)),
expected: "error, status code: 503, message: That model...",
},
{
name: "503 no message (Unknown response)",
httpCode: http.StatusServiceUnavailable,
body: bytes.NewReader([]byte(`
{
"error":{}
}`)),
expected: "error, status code: 503, message: ",
},
}

for _, tc := range testCases {
Expand Down

0 comments on commit fe1edcd

Please sign in to comment.