MCPcopy
hub / github.com/minio/minio-go / TestErrorResponse

Function TestErrorResponse

api_unit_test.go:58–74  ·  view source on GitHub ↗

Tests error response structure.

(t *testing.T)

Source from the content-addressed store, hash-verified

56
57// Tests error response structure.
58func TestErrorResponse(t *testing.T) {
59 var err error
60 err = ErrorResponse{
61 Code: Testing,
62 }
63 errResp := ToErrorResponse(err)
64 if errResp.Code != Testing {
65 t.Fatal("Type conversion failed, we have an empty struct.")
66 }
67
68 // Should fail with invalid argument.
69 err = httpRespToErrorResponse(nil, "", "")
70 errResp = ToErrorResponse(err)
71 if errResp.Code != InvalidArgument {
72 t.Fatal("Empty response input should return invalid argument.")
73 }
74}
75
76// Tests signature type.
77func TestSignatureType(t *testing.T) {

Callers

nothing calls this directly

Calls 2

ToErrorResponseFunction · 0.85
httpRespToErrorResponseFunction · 0.85

Tested by

no test coverage detected