This commit is contained in:
Marc Hernandez Cabot 2020-02-21 09:05:42 +01:00
parent b49ece0b87
commit 9ad10bb6f7
2 changed files with 7 additions and 7 deletions

View File

@ -211,7 +211,7 @@ flake8-ignore =
tests/test_logformatter.py E128 E501 E122
tests/test_mail.py E128 E501
tests/test_middleware.py E501 E128
tests/test_pipeline_crawl.py E131 E501 E128 E126
tests/test_pipeline_crawl.py E501 E128 E126
tests/test_pipeline_files.py E501
tests/test_pipeline_images.py F841 E501
tests/test_pipeline_media.py E501 E741 E731 E128 E502

View File

@ -26,10 +26,9 @@ class MediaDownloadSpider(SimpleSpider):
self.media_key: [],
self.media_urls_key: [
self._process_url(response.urljoin(href))
for href in response.xpath('''
//table[thead/tr/th="Filename"]
/tbody//a/@href
''').getall()],
for href in response.xpath(
'//table[thead/tr/th="Filename"]/tbody//a/@href'
).getall()],
}
yield item
@ -99,8 +98,9 @@ class FileDownloadCrawlTestCase(TestCase):
if self.expected_checksums is not None:
checksums = set(
i['checksum']
for item in items
for i in item[self.media_key])
for item in items
for i in item[self.media_key]
)
self.assertEqual(checksums, self.expected_checksums)
# check that the image files where actually written to the media store