Documentation
¶
Overview ¶
Package testutil provides shared mock-controller test helpers for the controller and site package tests.
Index ¶
Constants ¶
const ( // TestControllerID is the omadacId served by the mock controller. TestControllerID = "abc" // TestControllerVer is the controller version served by the mock controller. TestControllerVer = "6.2.10.18" )
Variables ¶
This section is empty.
Functions ¶
func LoginCount ¶
func LoginCount() int
LoginCount returns the total number of logins performed by mock controllers created via NewTestClient.
func NewTestClient ¶
func NewTestClient(t *testing.T, handler http.HandlerFunc) *controller.Controller
NewTestClient starts a mock Omada controller serving /api/info, login, and the site-1 lookup, then creates a logged-in Controller. All other requests are delegated to handler. The site-1 lookup is first offered to handler; if the handler answers 404, the standard site-1 info is served so site-scoped handles can be created without every test mocking the lookup.
Types ¶
This section is empty.