No need to set param with default
This commit is contained in:
parent
0999501600
commit
8be8c4efb6
|
@ -78,7 +78,7 @@ class TestPyLastArtist(TestPyLastWithLastFm):
|
||||||
artist = self.network.get_top_artists(limit=1)[0].item
|
artist = self.network.get_top_artists(limit=1)[0].item
|
||||||
|
|
||||||
# Act
|
# Act
|
||||||
things = artist.get_top_tracks(limit=2, stream=False)
|
things = artist.get_top_tracks(limit=2)
|
||||||
|
|
||||||
# Assert
|
# Assert
|
||||||
self.helper_two_different_things_in_top_list(things, pylast.Track)
|
self.helper_two_different_things_in_top_list(things, pylast.Track)
|
||||||
|
@ -101,7 +101,7 @@ class TestPyLastArtist(TestPyLastWithLastFm):
|
||||||
artist = self.network.get_top_artists(limit=1)[0].item
|
artist = self.network.get_top_artists(limit=1)[0].item
|
||||||
|
|
||||||
# Act
|
# Act
|
||||||
things = artist.get_top_albums(limit=limit, stream=False)
|
things = artist.get_top_albums(limit=limit)
|
||||||
|
|
||||||
# Assert
|
# Assert
|
||||||
assert len(things) == 1
|
assert len(things) == 1
|
||||||
|
@ -113,7 +113,7 @@ class TestPyLastArtist(TestPyLastWithLastFm):
|
||||||
artist = self.network.get_top_artists(limit=1)[0].item
|
artist = self.network.get_top_artists(limit=1)[0].item
|
||||||
|
|
||||||
# Act
|
# Act
|
||||||
things = artist.get_top_albums(limit=limit, stream=False)
|
things = artist.get_top_albums(limit=limit)
|
||||||
|
|
||||||
# Assert
|
# Assert
|
||||||
assert len(things) == 50
|
assert len(things) == 50
|
||||||
|
|
|
@ -153,7 +153,7 @@ class TestPyLastNetwork(TestPyLastWithLastFm):
|
||||||
country = self.network.get_country("Croatia")
|
country = self.network.get_country("Croatia")
|
||||||
|
|
||||||
# Act
|
# Act
|
||||||
things = country.get_top_tracks(limit=2, stream=False)
|
things = country.get_top_tracks(limit=2)
|
||||||
|
|
||||||
# Assert
|
# Assert
|
||||||
self.helper_two_different_things_in_top_list(things, pylast.Track)
|
self.helper_two_different_things_in_top_list(things, pylast.Track)
|
||||||
|
@ -171,7 +171,7 @@ class TestPyLastNetwork(TestPyLastWithLastFm):
|
||||||
tag = self.network.get_tag("blues")
|
tag = self.network.get_tag("blues")
|
||||||
|
|
||||||
# Act
|
# Act
|
||||||
things = tag.get_top_tracks(limit=2, stream=False)
|
things = tag.get_top_tracks(limit=2)
|
||||||
|
|
||||||
# Assert
|
# Assert
|
||||||
self.helper_two_different_things_in_top_list(things, pylast.Track)
|
self.helper_two_different_things_in_top_list(things, pylast.Track)
|
||||||
|
|
|
@ -94,8 +94,8 @@ class TestPyLastWithLastFm(PyLastTestCase):
|
||||||
func = getattr(thing, function_name, None)
|
func = getattr(thing, function_name, None)
|
||||||
|
|
||||||
# Act
|
# Act
|
||||||
result1 = func(limit=1, cacheable=False, stream=False)
|
result1 = func(limit=1, cacheable=False)
|
||||||
result2 = func(limit=1, cacheable=True, stream=False)
|
result2 = func(limit=1, cacheable=True)
|
||||||
result3 = list(func(limit=1))
|
result3 = list(func(limit=1))
|
||||||
|
|
||||||
# Assert
|
# Assert
|
||||||
|
|
|
@ -143,10 +143,10 @@ class TestPyLastUser(TestPyLastWithLastFm):
|
||||||
user = self.network.get_user("test-user")
|
user = self.network.get_user("test-user")
|
||||||
|
|
||||||
# Act/Assert
|
# Act/Assert
|
||||||
assert len(user.get_loved_tracks(limit=20, stream=False)) == 20
|
assert len(user.get_loved_tracks(limit=20)) == 20
|
||||||
assert len(user.get_loved_tracks(limit=100, stream=False)) <= 100
|
assert len(user.get_loved_tracks(limit=100)) <= 100
|
||||||
assert len(user.get_loved_tracks(limit=None, stream=False)) >= 23
|
assert len(user.get_loved_tracks(limit=None)) >= 23
|
||||||
assert len(user.get_loved_tracks(limit=0, stream=False)) >= 23
|
assert len(user.get_loved_tracks(limit=0)) >= 23
|
||||||
|
|
||||||
def test_user_is_hashable(self):
|
def test_user_is_hashable(self):
|
||||||
# Arrange
|
# Arrange
|
||||||
|
@ -211,7 +211,7 @@ class TestPyLastUser(TestPyLastWithLastFm):
|
||||||
lastfm_user = self.network.get_user("RJ")
|
lastfm_user = self.network.get_user("RJ")
|
||||||
|
|
||||||
# Act
|
# Act
|
||||||
things = lastfm_user.get_top_tracks(limit=2, stream=False)
|
things = lastfm_user.get_top_tracks(limit=2)
|
||||||
|
|
||||||
# Assert
|
# Assert
|
||||||
self.helper_two_different_things_in_top_list(things, pylast.Track)
|
self.helper_two_different_things_in_top_list(things, pylast.Track)
|
||||||
|
@ -362,9 +362,7 @@ class TestPyLastUser(TestPyLastWithLastFm):
|
||||||
utc_end = calendar.timegm(end.utctimetuple())
|
utc_end = calendar.timegm(end.utctimetuple())
|
||||||
|
|
||||||
# Act
|
# Act
|
||||||
tracks = lastfm_user.get_recent_tracks(
|
tracks = lastfm_user.get_recent_tracks(time_from=utc_start, time_to=utc_end)
|
||||||
time_from=utc_start, time_to=utc_end, stream=False
|
|
||||||
)
|
|
||||||
|
|
||||||
# Assert
|
# Assert
|
||||||
assert len(tracks) == 1
|
assert len(tracks) == 1
|
||||||
|
@ -382,7 +380,7 @@ class TestPyLastUser(TestPyLastWithLastFm):
|
||||||
|
|
||||||
# Act
|
# Act
|
||||||
tracks = lastfm_user.get_recent_tracks(
|
tracks = lastfm_user.get_recent_tracks(
|
||||||
time_from=utc_start, time_to=utc_end, limit=None, stream=False
|
time_from=utc_start, time_to=utc_end, limit=None
|
||||||
)
|
)
|
||||||
|
|
||||||
# Assert
|
# Assert
|
||||||
|
@ -469,7 +467,7 @@ class TestPyLastUser(TestPyLastWithLastFm):
|
||||||
user = self.network.get_user("bbc6music")
|
user = self.network.get_user("bbc6music")
|
||||||
|
|
||||||
# Act
|
# Act
|
||||||
scrobbles = user.get_track_scrobbles(artist, title, stream=False)
|
scrobbles = user.get_track_scrobbles(artist, title)
|
||||||
|
|
||||||
# Assert
|
# Assert
|
||||||
assert len(scrobbles) > 0
|
assert len(scrobbles) > 0
|
||||||
|
@ -483,7 +481,7 @@ class TestPyLastUser(TestPyLastWithLastFm):
|
||||||
user = self.network.get_user("bbc6music")
|
user = self.network.get_user("bbc6music")
|
||||||
|
|
||||||
# Act
|
# Act
|
||||||
result1 = user.get_track_scrobbles(artist, title, cacheable=False, stream=False)
|
result1 = user.get_track_scrobbles(artist, title, cacheable=False)
|
||||||
result2 = list(user.get_track_scrobbles(artist, title, cacheable=True))
|
result2 = list(user.get_track_scrobbles(artist, title, cacheable=True))
|
||||||
result3 = list(user.get_track_scrobbles(artist, title))
|
result3 = list(user.get_track_scrobbles(artist, title))
|
||||||
|
|
||||||
|
@ -500,4 +498,4 @@ class TestPyLastUser(TestPyLastWithLastFm):
|
||||||
match="Deprecated - This type of request is no longer supported",
|
match="Deprecated - This type of request is no longer supported",
|
||||||
):
|
):
|
||||||
warnings.filterwarnings("ignore", category=DeprecationWarning)
|
warnings.filterwarnings("ignore", category=DeprecationWarning)
|
||||||
lastfm_user.get_artist_tracks(artist="Test Artist", stream=False)
|
lastfm_user.get_artist_tracks(artist="Test Artist")
|
||||||
|
|
Loading…
Reference in a new issue