mirror of
https://github.com/beetbox/beets.git
synced 2025-12-15 13:07:09 +01:00
Add test for lyrics
This commit is contained in:
parent
bdf9eb2a26
commit
30106d105c
2 changed files with 1154 additions and 1 deletions
|
|
@ -492,7 +492,17 @@ class GeniusScrapeLyricsFromHtmlTest(GeniusBaseTest):
|
|||
"""Ensure we are able to scrape a page with lyrics"""
|
||||
url = "https://genius.com/Ttng-chinchilla-lyrics"
|
||||
mock = MockFetchUrl()
|
||||
self.assertIsNotNone(genius._scrape_lyrics_from_html(mock(url)))
|
||||
lyrics = genius._scrape_lyrics_from_html(mock(url))
|
||||
self.assertIsNotNone(lyrics)
|
||||
self.assertEqual(lyrics.count("\n"), 28)
|
||||
|
||||
def test_good_lyrics_multiple_divs(self):
|
||||
"""Ensure we are able to scrape a page with lyrics"""
|
||||
url = "https://genius.com/2pac-all-eyez-on-me-lyrics"
|
||||
mock = MockFetchUrl()
|
||||
lyrics = genius._scrape_lyrics_from_html(mock(url))
|
||||
self.assertIsNotNone(lyrics)
|
||||
self.assertEqual(lyrics.count("\n"), 133)
|
||||
|
||||
# TODO: find an example of a lyrics page with multiple divs and test it
|
||||
|
||||
|
|
|
|||
1143
test/rsrc/lyrics/geniuscom/2pacalleyezonmelyrics.txt
Normal file
1143
test/rsrc/lyrics/geniuscom/2pacalleyezonmelyrics.txt
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue