(t *testing.T)
| 255 | } |
| 256 | |
| 257 | func TestSmokeInfoValidIP(t *testing.T) { |
| 258 | ctiClient := NewCrowdsecCTIClient(WithAPIKey(validApiKey), WithHTTPClient(&http.Client{ |
| 259 | Transport: RoundTripFunc(smokeHandler), |
| 260 | })) |
| 261 | |
| 262 | resp, err := ctiClient.GetIPInfo("1.1.1.1") |
| 263 | if err != nil { |
| 264 | t.Fatalf("failed to get ip info: %s", err) |
| 265 | } |
| 266 | |
| 267 | assert.Equal(t, "1.1.1.1", resp.Ip) |
| 268 | assert.Equal(t, new("1.1.1.0/24"), resp.IpRange) |
| 269 | } |
| 270 | |
| 271 | func TestSmokeUnknownIP(t *testing.T) { |
| 272 | ctiClient := NewCrowdsecCTIClient(WithAPIKey(validApiKey), WithHTTPClient(&http.Client{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…