MCPcopy
hub / github.com/andeya/pholcus / TestCrawler_Process_downloadError

Function TestCrawler_Process_downloadError

app/crawler/crawler_test.go:117–129  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

115}
116
117func TestCrawler_Process_downloadError(t *testing.T) {
118 scheduler.Init(4, 0)
119 cr := New(0, &errorDownloader{}, "csv", 10).(*crawler)
120 sp := &spider.Spider{
121 Name: "TestSpider",
122 RuleTree: &spider.RuleTree{Trunk: map[string]*spider.Rule{}},
123 Limit: -5,
124 }
125 cr.Init(sp)
126 req := &request.Request{URL: "http://example.com", Rule: "r"}
127 req.Prepare()
128 cr.Process(req)
129}
130
131func TestCrawler_Run(t *testing.T) {
132 scheduler.Init(4, 0)

Callers

nothing calls this directly

Calls 5

PrepareMethod · 0.95
InitFunction · 0.92
NewFunction · 0.70
InitMethod · 0.65
ProcessMethod · 0.65

Tested by

no test coverage detected