mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2025-11-03 20:40:25 +08:00
25 lines
430 B
Go
25 lines
430 B
Go
package ipconfigs
|
|
|
|
import (
|
|
"net/http"
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
func TestHTTPAction_Run(t *testing.T) {
|
|
action := &HTTPAction{
|
|
URL: "http://127.0.0.1:1234/get?hello=world",
|
|
Method: http.MethodGet,
|
|
Params: map[string]string{"a": "b"},
|
|
ParamName: "IP",
|
|
}
|
|
err := action.Run(&IPItemConfig{
|
|
IPFrom: "192.168.1.100",
|
|
ExpiredAt: time.Now().Unix() + 3600,
|
|
})
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
t.Log("ok")
|
|
}
|