Documentation
¶
Overview ¶
Package testutil holds small assertion helpers shared across this repo's test files. It is a regular (non-_test.go) package so it can be imported from other packages' tests, unlike a _test.go file which Go restricts to its own package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RequireBadReqCode ¶
RequireBadReqCode asserts that errors.As finds a *model.CodedErr in err, that its status is 400, and that its BecknError().Code equals wantCode. Shared by every plugin test suite that classifies failures as bad requests (reqmapper, router, reqpreprocessor, encrypter, decrypter, ...) instead of each reimplementing the same assertion locally.
The status is checked because one CodedErr type now covers 400, 401 and 404, so matching the type alone would also accept the other two.
Types ¶
This section is empty.