hunter/pre_driver_com_test.go

21 lines
390 B
Go
Raw Normal View History

2020-04-10 10:54:19 +00:00
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()
}