Esempio n. 1
0
 def test_mocked_source_ok(self):
     """Test that lyrics of the mocked page are correctly scraped"""
     url = self.source["url"] + self.source["path"]
     if os.path.isfile(url_to_filename(url)):
         res = lyrics.scrape_lyrics_from_html(raw_backend.fetch_url(url))
         self.assertTrue(google.is_lyrics(res), url)
         self.assertTrue(is_lyrics_content_ok(self.source["title"], res), url)
Esempio n. 2
0
 def test_mocked_source_ok(self):
     """Test that lyrics of the mocked page are correctly scraped"""
     url = self.source['url'] + self.source['path']
     res = lyrics.scrape_lyrics_from_html(raw_backend.fetch_url(url))
     self.assertTrue(google.is_lyrics(res), url)
     self.assertTrue(is_lyrics_content_ok(self.source['title'], res),
                     url)
Esempio n. 3
0
 def test_mocked_source_ok(self):
     """Test that lyrics of the mocked page are correctly scraped"""
     url = self.source['url'] + self.source['path']
     if os.path.isfile(url_to_filename(url)):
         res = lyrics.scrape_lyrics_from_html(lyrics.fetch_url(url))
         self.assertTrue(lyrics.is_lyrics(res), url)
         self.assertTrue(is_lyrics_content_ok(self.source['title'], res),
                         url)
Esempio n. 4
0
 def test_google_sources_ok(self):
     """Test if lyrics present on websites registered in beets google custom
        search engine are correctly scraped.
     """
     for s in self.GOOGLE_SOURCES:
         url = s['url'] + s['path']
         res = lyrics.scrape_lyrics_from_html(raw_backend.fetch_url(url))
         self.assertTrue(google.is_lyrics(res), url)
         self.assertTrue(is_lyrics_content_ok(s['title'], res), url)
Esempio n. 5
0
 def test_google_sources_ok(self):
     """Test if lyrics present on websites registered in beets google custom
        search engine are correctly scraped.
     """
     for s in self.GOOGLE_SOURCES:
         url = s['url'] + s['path']
         res = lyrics.scrape_lyrics_from_html(
             raw_backend.fetch_url(url))
         self.assertTrue(google.is_lyrics(res), url)
         self.assertTrue(is_lyrics_content_ok(s['title'], res), url)
Esempio n. 6
0
 def test_google_sources_ok(self):
     """Test if lyrics present on websites registered in beets google custom
     search engine are correctly scraped."""
     if not check_lyrics_fetched():
         self.skipTest("Run lyrics_download_samples.py script first.")
     for s in GOOGLE_SOURCES:
         url = s['url'] + s['path']
         if os.path.isfile(url_to_filename(url)):
             res = lyrics.scrape_lyrics_from_html(lyrics.fetch_url(url))
             self.assertTrue(lyrics.is_lyrics(res), url)
             self.assertTrue(is_lyrics_content_ok(s['title'], res), url)
Esempio n. 7
0
 def test_google_sources_ok(self):
     """Test if lyrics present on websites registered in beets google custom
     search engine are correctly scraped."""
     if not check_lyrics_fetched():
         self.skipTest("Run lyrics_download_samples.py script first.")
     for s in GOOGLE_SOURCES:
         url = s["url"] + s["path"]
         if os.path.isfile(url_to_filename(url)):
             res = lyrics.scrape_lyrics_from_html(raw_backend.fetch_url(url))
             self.assertTrue(google.is_lyrics(res), url)
             self.assertTrue(is_lyrics_content_ok(s["title"], res), url)
Esempio n. 8
0
 def test_google_sources_ok(self):
     """Test if lyrics present on websites registered in beets google custom
        search engine are correctly scraped.
     """
     # Don't test any sources marked as skipped.
     sources = [s for s in self.GOOGLE_SOURCES if not s.get("skip", False)]
     for s in sources:
         url = s['url'] + s['path']
         res = lyrics.scrape_lyrics_from_html(raw_backend.fetch_url(url))
         self.assertTrue(google.is_lyrics(res), url)
         self.assertTrue(is_lyrics_content_ok(s['title'], res), url)
Esempio n. 9
0
 def test_sources_ok(self):
     for s in self.sourcesOk:
         url = s['url'] + s['path']
         res = lyrics.scrape_lyrics_from_html(lyrics.fetch_url(url))
         self.assertTrue(lyrics.is_lyrics(res), url)
         self.assertTrue(is_lyrics_content_ok(s['title'], res), url)
Esempio n. 10
0
 def test_sources_ok(self):
     for s in self.sourcesOk:
         url = s['url'] + s['path']
         res = lyrics.scrape_lyrics_from_html(lyrics.fetch_url(url))
         self.assertTrue(lyrics.is_lyrics(res), url)
         self.assertTrue(is_lyrics_content_ok(s['title'], res), url)