def test_aao_scraper_finds_image(self): self.page_text = """ <br /> <a href="TARGET_URL" title="View larger image" class="thickbox" style="color: #7E9DA2; text-decoration:none;"> <img src="http://www.albumart.org/images/zoom-icon.jpg" alt="View larger image" width="17" height="15" border="0"/></a> """ res = fetchart.aao_art('x') self.assertEqual(res, 'TARGET_URL')
def test_aao_scraper_finds_image(self): body = """ <br /> <a href="TARGET_URL" title="View larger image" class="thickbox" style="color: #7E9DA2; text-decoration:none;"> <img src="http://www.albumart.org/images/zoom-icon.jpg" alt="View larger image" width="17" height="15" border="0"/></a> """ self.mock_response(self.AAO_URL, body) album = _common.Bag(asin=self.ASIN) res = fetchart.aao_art(album) self.assertEqual(list(res)[0], 'TARGET_URL')
def test_aao_scraper_returns_none_when_no_image_present(self): self.page_text = "blah blah" res = fetchart.aao_art('x') self.assertEqual(res, None)
def test_aao_scraper_returns_none_when_no_image_present(self): self.mock_response(self.AAO_URL, 'blah blah') res = fetchart.aao_art(self.ASIN) self.assertEqual(res, None)
def test_aao_scraper_returns_none_when_no_image_present(self): self.page_text = "blah blah" res = fetchart.aao_art('x') self.assertEqual(self.retriever.fetched, None) self.assertEqual(res, None)
def test_aao_scraper_returns_no_result_when_no_image_present(self): self.mock_response(self.AAO_URL, 'blah blah') album = _common.Bag(asin=self.ASIN) res = fetchart.aao_art(album) self.assertEqual(list(res), [])