Exemplo n.º 1
0
 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')
Exemplo n.º 2
0
 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')
Exemplo n.º 3
0
 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')
Exemplo n.º 4
0
 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')
Exemplo n.º 5
0
 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)
Exemplo n.º 6
0
 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)
Exemplo n.º 7
0
 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)
Exemplo n.º 8
0
 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)
Exemplo n.º 9
0
 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), [])
Exemplo n.º 10
0
 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), [])