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

updated tests to check for unique genres and artists #6

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
9 changes: 9 additions & 0 deletions lib/testing/song_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,22 @@ def test_has_genres(self):
assert("Rap" in Song.genres)
assert("Pop" in Song.genres)
assert("Rock" in Song.genres)


def test_unique_genres(self):
'''all song genres are unique.'''
assert len(Song.genres) == len(set(Song.genres))

def test_has_artists(self):
'''keeps track of all Song artists.'''
assert("Jay Z" in Song.artists)
assert("Beyonce" in Song.artists)
assert("Hall and Oates" in Song.artists)

def test_unique_artists(self):
'''all song artists are unique.'''
assert len(Song.artists) == len(set(Song.artists))

def test_has_genre_count(self):
'''keeps count of Songs for each genre.'''
assert(Song.genre_count["Rap"] == 1)
Expand Down