(t *testing.T)
| 103 | } |
| 104 | |
| 105 | func 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 | } |
nothing calls this directly
no test coverage detected