MCPcopy Create free account
hub / github.com/ericls/imgdd / assertFileTooLarge

Function assertFileTooLarge

httpserver/image_handlers_test.go:103–108  ·  view source on GitHub ↗

assertFileTooLarge checks the response indicates the file size was rejected.

(t *testing.T, res *httptest.ResponseRecorder)

Source from the content-addressed store, hash-verified

101
102// assertFileTooLarge checks the response indicates the file size was rejected.
103func assertFileTooLarge(t *testing.T, res *httptest.ResponseRecorder) {
104 t.Helper()
105 if res.Code != http.StatusBadRequest || !strings.Contains(res.Body.String(), "File too large") {
106 t.Fatalf("expected 400 File too large, got %d: %s", res.Code, res.Body.String())
107 }
108}
109
110// assertNotFileTooLarge checks the response was NOT rejected due to size.
111func assertNotFileTooLarge(t *testing.T, res *httptest.ResponseRecorder) {

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected