Merge pull request #293 from pylast/fix-test

Fix the build
This commit is contained in:
Hugo 2019-02-03 14:23:20 +02:00 committed by GitHub
commit d9c086f8cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,6 +2,7 @@
"""
Integration (not unit) tests for pylast.py
"""
import time
import unittest
import pylast
@ -10,7 +11,6 @@ from .test_pylast import PY37, TestPyLastWithLastFm
class TestPyLastTrack(TestPyLastWithLastFm):
@unittest.skipUnless(PY37, "Only run on Python 3.7 to avoid collisions")
def test_love(self):
# Arrange
artist = "Test Artist"
@ -20,12 +20,14 @@ class TestPyLastTrack(TestPyLastWithLastFm):
# Act
track.love()
time.sleep(1) # Delay, for Last.fm latency. TODO Can this be removed later?
# Assert
loved = lastfm_user.get_loved_tracks(limit=1)
self.assertEqual(str(loved[0].track.artist).lower(), "test artist")
self.assertEqual(str(loved[0].track.title).lower(), "test title")
@unittest.skipUnless(PY37, "Only run on Python 3.7 to avoid collisions")
def test_unlove(self):
# Arrange
artist = pylast.Artist("Test Artist", self.network)