MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / TestHTTPAPIAction_AddItem

Function TestHTTPAPIAction_AddItem

internal/iplibrary/action_http_api_test.go:10–29  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

8)
9
10func TestHTTPAPIAction_AddItem(t *testing.T) {
11 if !testutils.IsSingleTesting() {
12 return
13 }
14
15 var action = NewHTTPAPIAction()
16 action.config = &firewallconfigs.FirewallActionHTTPAPIConfig{
17 URL: "http://127.0.0.1:2345/post",
18 TimeoutSeconds: 0,
19 }
20 err := action.AddItem(IPListTypeBlack, &pb.IPItem{
21 Type: "ipv4",
22 Id: 1,
23 IpFrom: "192.168.1.100",
24 })
25 if err != nil {
26 t.Fatal(err)
27 }
28 t.Log("ok")
29}
30
31func TestHTTPAPIAction_DeleteItem(t *testing.T) {
32 if !testutils.IsSingleTesting() {

Callers

nothing calls this directly

Calls 4

IsSingleTestingFunction · 0.92
NewHTTPAPIActionFunction · 0.85
LogMethod · 0.80
AddItemMethod · 0.65

Tested by

no test coverage detected