Merge pull request #213 from pylast/fix-positional-argument

Fix Album.get_tracks() positional argument
This commit is contained in:
Hugo 2017-09-18 14:56:38 +03:00 committed by GitHub
commit ac6b67ff1e
2 changed files with 3 additions and 1 deletions

View file

@ -1784,7 +1784,7 @@ class Album(_Opus):
return _extract_tracks(
self._request(
self.ws_prefix + ".getInfo", cacheable=True), "tracks")
self.ws_prefix + ".getInfo", cacheable=True), self.network)
def get_url(self, domain_name=DOMAIN_ENGLISH):
"""Returns the URL of the album or track page on the network.

View file

@ -1887,11 +1887,13 @@ class TestPyLast(unittest.TestCase):
# Act
tracks = album.get_tracks()
url = tracks[0].get_url()
# Assert
self.assertIsInstance(tracks, list)
self.assertIsInstance(tracks[0], pylast.Track)
self.assertEqual(len(tracks), 4)
self.assertTrue(url.startswith("https://www.last.fm/music/test"))
@handle_lastfm_exceptions
def test_tags(self):