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

Function TestRateLimit

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

Source from the content-addressed store, hash-verified

282}
283
284func TestRateLimit(t *testing.T) {
285 ctiClient := NewCrowdsecCTIClient(WithAPIKey(validApiKey), WithHTTPClient(&http.Client{
286 Transport: RoundTripFunc(rateLimitedHandler),
287 }))
288 _, err := ctiClient.GetIPInfo("1.1.1.1")
289 require.EqualError(t, err, ErrLimit.Error())
290}
291
292func TestSearchIPs(t *testing.T) {
293 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
RoundTripFuncFuncType · 0.70
ErrorMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…