(self)
| 174 | spider_class = CSVFeedSpider |
| 175 | |
| 176 | def test_parse_rows(self): |
| 177 | body = get_testdata("feeds", "feed-sample6.csv") |
| 178 | response = Response("http://example.org/dummy.csv", body=body) |
| 179 | |
| 180 | class _CrawlSpider(self.spider_class): |
| 181 | name = "test" |
| 182 | delimiter = "," |
| 183 | quotechar = "'" |
| 184 | |
| 185 | def parse_row(self, response, row): |
| 186 | return row |
| 187 | |
| 188 | spider = _CrawlSpider() |
| 189 | rows = list(spider.parse_rows(response)) |
| 190 | assert rows[0] == {"id": "1", "name": "alpha", "value": "foobar"} |
| 191 | assert len(rows) == 4 |
| 192 | |
| 193 | |
| 194 | class TestNoParseMethodSpider: |
nothing calls this directly
no test coverage detected