MCPcopy
hub / github.com/crowdsecurity/crowdsec / NewAPITest

Function NewAPITest

pkg/apiserver/apiserver_test.go:155–165  ·  view source on GitHub ↗
(t *testing.T, ctx context.Context)

Source from the content-addressed store, hash-verified

153}
154
155func NewAPITest(t *testing.T, ctx context.Context) (*gin.Engine, csconfig.Config) {
156 apiServer, config := NewAPIServer(t, ctx)
157
158 err := apiServer.InitController()
159 require.NoError(t, err)
160
161 router, err := apiServer.Router()
162 require.NoError(t, err)
163
164 return router, config
165}
166
167func NewAPITestForwardedFor(t *testing.T) (*gin.Engine, csconfig.Config) {
168 ctx := t.Context()

Callers 11

TestCreateMachineFunction · 0.85
TestAutoRegistrationFunction · 0.85
TestLoginFunction · 0.85
InitMachineTestFunction · 0.85
TestAPIKeyFunction · 0.85
TestUnknownPathFunction · 0.85

Calls 3

InitControllerMethod · 0.95
RouterMethod · 0.95
NewAPIServerFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…