hunter/pre_driver_com_test.go
huangsimin bcdc197376 driver
2020-04-10 18:54:19 +08:00

21 lines
390 B
Go

package hunter
import "testing"
type WebPreDriverUrl struct {
PreDriverUrl
}
func (web *WebPreDriverUrl) Execute(cxt *TaskContext) {
resp, err := cxt.Hunt()
if err != nil {
panic(err)
}
cxt.SetShare("test", resp.Content())
}
func TestDriver(t *testing.T) {
hunter := NewHunter(&WebPreDriverUrl{PreDriverUrl("http://httpbin.org")}) // first params PreCurlUrl
hunter.Execute()
}