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

Function TestSmokeUnknownIP

pkg/cticlient/client_test.go:271–282  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

269}
270
271func TestSmokeUnknownIP(t *testing.T) {
272 ctiClient := NewCrowdsecCTIClient(WithAPIKey(validApiKey), WithHTTPClient(&http.Client{
273 Transport: RoundTripFunc(smokeHandler),
274 }))
275
276 resp, err := ctiClient.GetIPInfo("42.42.42.42")
277 if err != nil {
278 t.Fatalf("failed to get ip info: %s", err)
279 }
280
281 assert.Empty(t, resp.Ip)
282}
283
284func TestRateLimit(t *testing.T) {
285 ctiClient := NewCrowdsecCTIClient(WithAPIKey(validApiKey), WithHTTPClient(&http.Client{

Callers

nothing calls this directly

Calls 6

GetIPInfoMethod · 0.95
NewCrowdsecCTIClientFunction · 0.85
WithAPIKeyFunction · 0.85
WithHTTPClientFunction · 0.85
EmptyMethod · 0.80
RoundTripFuncFuncType · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…