28 lines
473 B
Go
28 lines
473 B
Go
package test
|
|
|
|
import (
|
|
"encoding/json"
|
|
"testing"
|
|
|
|
"git.nite07.com/nite/go-flaresolverr"
|
|
)
|
|
|
|
func TestGetV1(t *testing.T) {
|
|
f, err := flaresolverr.GetInstance("http://100.64.0.1:8191", "", "")
|
|
if err != nil {
|
|
t.Error(err)
|
|
return
|
|
}
|
|
resp, err := f.GetV1("https://nopecha.com/demo/cloudflare", nil)
|
|
if err != nil {
|
|
t.Error(err)
|
|
return
|
|
}
|
|
if resp.Solution.Status != 200 {
|
|
t.Fail()
|
|
} else {
|
|
jsonBytes, _ := json.Marshal(resp)
|
|
t.Log(string(jsonBytes))
|
|
}
|
|
}
|