Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests #275

Merged
merged 3 commits into from
Dec 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lyricsgenius/api/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
self.authorization_header = {}
else:
if not access_token or not isinstance(access_token, str):
raise TypeError('Invalid token')

Check failure on line 37 in lyricsgenius/api/base.py

View workflow job for this annotation

GitHub Actions / build (3.7)

Invalid token

Check failure on line 37 in lyricsgenius/api/base.py

View workflow job for this annotation

GitHub Actions / build (3.7)

Invalid token
self.access_token = 'Bearer ' + access_token
self.authorization_header = {'authorization': self.access_token}

Expand Down Expand Up @@ -81,11 +81,11 @@
except Timeout as e:
error = "Request timed out:\n{e}".format(e=e)
if tries > self.retries:
raise Timeout(error)
raise Timeout(error) from e
except HTTPError as e:
error = get_description(e)
if response.status_code < 500 or tries > self.retries:
raise HTTPError(response.status_code, error)
raise HTTPError(response.status_code, error) from e

# Enforce rate limiting
time.sleep(self.sleep_time)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_genius.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ def setUpClass(cls):
cls.lyrics_ending = (
"[Outro]"
"\nNow I’m kicking leaves"
"\nCursing the one that I love and the one I dont"
"\nI wonder who youre thinking of"
"\nCursing the one that I love and the one I don't"
"\nI wonder who you're thinking of"
)

def test_lyrics_with_url(self):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_song.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def test_artist(self):
self.assertEqual(self.song.artist, self.artist_name)

def test_lyrics_raw(self):
lyrics = '[Verse 1: Andy Shauf]'
lyrics = '[Verse 1]'
self.assertTrue(self.song.lyrics.startswith(lyrics))

def test_lyrics_no_section_headers(self):
Expand Down
Loading