MCPcopy Create free account
hub / github.com/AbelChe/evil_minio / TestAPIErrCode

Function TestAPIErrCode

cmd/api-errors_test.go:69–82  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

67}
68
69func TestAPIErrCode(t *testing.T) {
70 disk := filepath.Join(globalTestTmpDir, "minio-"+nextSuffix())
71 defer os.RemoveAll(disk)
72
73 initFSObjects(disk, t)
74
75 ctx := context.Background()
76 for i, testCase := range toAPIErrorTests {
77 errCode := toAPIErrorCode(ctx, testCase.err)
78 if errCode != testCase.errCode {
79 t.Errorf("Test %d: Expected error code %d, got %d", i+1, testCase.errCode, errCode)
80 }
81 }
82}
83
84// Check if an API error is properly defined
85func TestAPIErrCodeDefinition(t *testing.T) {

Callers

nothing calls this directly

Calls 3

nextSuffixFunction · 0.85
initFSObjectsFunction · 0.85
toAPIErrorCodeFunction · 0.85

Tested by

no test coverage detected