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

Function TestPipeline_StartStopCollect

app/pipeline/pipeline_test.go:105–119  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

103}
104
105func TestPipeline_StartStopCollect(t *testing.T) {
106 sp := &spider.Spider{
107 Name: "PipeSpider",
108 RuleTree: &spider.RuleTree{Trunk: map[string]*spider.Rule{"r1": {ItemFields: []string{"f1"}}}},
109 }
110 p := New(sp, "csv", 2)
111 p.Start()
112 defer p.Stop()
113
114 cell := data.GetDataCell("r1", map[string]interface{}{"f1": "v1"}, "u", "pu", "dt")
115 r := p.CollectData(cell)
116 if r.IsErr() {
117 t.Errorf("CollectData: %v", r.UnwrapErr())
118 }
119}

Callers

nothing calls this directly

Calls 5

GetDataCellFunction · 0.92
NewFunction · 0.70
StartMethod · 0.65
StopMethod · 0.65
CollectDataMethod · 0.65

Tested by

no test coverage detected