From d06f96388d754ed41876f7fccb63f84241d44963 Mon Sep 17 00:00:00 2001 From: Michaƫl Ball Date: Sun, 26 Mar 2017 10:19:59 +0100 Subject: Works on python 2/pypy --- tests/models/artist_test.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'tests/models/artist_test.py') diff --git a/tests/models/artist_test.py b/tests/models/artist_test.py index bb66813..b3504a1 100644 --- a/tests/models/artist_test.py +++ b/tests/models/artist_test.py @@ -2,27 +2,27 @@ from models.artist import Artist def test_instance(database): - album = Artist(id=1, db=database) + album = Artist(database, 1) assert album.id == 1 assert album.name == "Artist 1" def test_albums(database): - artist1 = Artist(id=1, db=database) + artist1 = Artist(database, 1) assert len(artist1.albums) == 0 - artist2 = Artist(id=2, db=database) + artist2 = Artist(database, 2) assert len(artist2.albums) == 1 assert artist2.albums[0].name == "Album 1" assert artist2.albums[0].date == "1999-02-04" def test_tracks(database): - artist1 = Artist(id=1, db=database) + artist1 = Artist(database, 1) assert len(artist1.tracks) == 1 assert artist1.tracks[0].name == "Non album track" assert artist1.tracks[0].tracknumber is None assert artist1.tracks[0].filename == "1.mp3" - artist2 = Artist(id=2, db=database) + artist2 = Artist(database, 2) assert artist2.tracks[0].name == "Album track 1" assert artist2.tracks[0].tracknumber == 1 assert artist2.tracks[0].filename == "album/1.mp3" @@ -40,28 +40,28 @@ def test_delete(database): artist_id = cursor.lastrowid - artist = Artist(artist_id, db=database) + artist = Artist(database, artist_id) assert artist.delete() - test_artist = Artist(artist_id, db=database) + test_artist = Artist(database, artist_id) assert not hasattr(test_artist, "name") def test_search(database): search_payload = {"name": {"data": "Artist 1", "operator": "="}} - artist_results = Artist.search(db=database, **search_payload) + artist_results = Artist.search(database, **search_payload) assert len(artist_results) > 0 invalid_search_payload = {"name": {"data": "This artist does not exist", "operator": "="}} - no_artist_results = Artist.search(db=database, **invalid_search_payload) + no_artist_results = Artist.search(database, **invalid_search_payload) assert len(no_artist_results) == 0 def test_all(database): - artist_results = Artist.all(db=database) + artist_results = Artist.all(database) assert len(artist_results) > 0 -- cgit v1.2.3