Skip to content

Commit

Permalink
Updated test for v3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
elmoiv authored Jun 15, 2020
1 parent ed9d776 commit c09eda8
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 14 deletions.
8 changes: 7 additions & 1 deletion tests/test1.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
from azapi import AZlyrics

# Names should be passed corrrectly
# If you can't remember, use google or duckduckgo
# AZlyrics('google')
api = AZlyrics()

api.getLyrics(artist='kendrick lamar', title='humble')
api.artist = 'Taylor Swift'
api.title = 'Blank Space'

api.getLyrics()
4 changes: 3 additions & 1 deletion tests/test2.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

api = AZlyrics()

songs = api.getSongs('Ed Sheeran')
api.artist = 'Ed Sheeran'

songs = api.getSongs()

pprint.pprint(songs, indent=5)
3 changes: 2 additions & 1 deletion tests/test3.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from azapi import AZlyrics

api = AZlyrics('Taylor Swift')
api = AZlyrics()

api.artist = 'Taylor Swift'
songs = api.getSongs()

for song in songs:
Expand Down
9 changes: 3 additions & 6 deletions tests/test4.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
from azapi import AZlyrics

api = AZlyrics()
api = AZlyrics('google')

# We are Searching for Meghan's song "All about that bass"
songs = api.search('about the bass', category = 'songs')
api.title = 'about that bass'

# Song appears to be the first in search results
song_url = songs[0]['url']

Lyrics = api.getLyrics(url = song_url)
Lyrics = api.getLyrics()

print(Lyrics)
8 changes: 5 additions & 3 deletions tests/test5.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
from azapi import AZlyrics

api = AZlyrics()
api = AZlyrics('google')

# Kanye is in the format of "West" in AZLyrics database
# Here we search for his name to fetch the correct url
songs = api.getSongs('Kanye', True)
api.artist = 'Kanye west'
songs = api.getSongs()

print(songs)
for song in songs:
print(song, songs[song]['year'])
8 changes: 6 additions & 2 deletions tests/test6.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
from azapi import AZlyrics

api = AZlyrics()
api = AZlyrics('duckduckgo')

# Mis-typing "Meghan Trainor" and "All about the bass"
api.artist = 'Mehgan trenor'
api.title = 'about this bass'

# Using search to get correct artist and title
Lyrics = api.getLyrics(artist='meghan', title='bass', search=True)
Lyrics = api.getLyrics()

print(Lyrics)

0 comments on commit c09eda8

Please sign in to comment.