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
|
||||
|
||||
# Act
|
||||
things = artist.get_top_tracks(limit=2, stream=False)
|
||||
things = artist.get_top_tracks(limit=2)
|
||||
|
||||
# Assert
|
||||
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
|
||||
|
||||
# Act
|
||||
things = artist.get_top_albums(limit=limit, stream=False)
|
||||
things = artist.get_top_albums(limit=limit)
|
||||
|
||||
# Assert
|
||||
assert len(things) == 1
|
||||
|
@ -113,7 +113,7 @@ class TestPyLastArtist(TestPyLastWithLastFm):
|
|||
artist = self.network.get_top_artists(limit=1)[0].item
|
||||
|
||||
# Act
|
||||
things = artist.get_top_albums(limit=limit, stream=False)
|
||||
things = artist.get_top_albums(limit=limit)
|
||||
|
||||
# Assert
|
||||
assert len(things) == 50
|
||||
|
|
|
@ -153,7 +153,7 @@ class TestPyLastNetwork(TestPyLastWithLastFm):
|
|||
country = self.network.get_country("Croatia")
|
||||
|
||||
# Act
|
||||
things = country.get_top_tracks(limit=2, stream=False)
|
||||
things = country.get_top_tracks(limit=2)
|
||||
|
||||
# Assert
|
||||
self.helper_two_different_things_in_top_list(things, pylast.Track)
|
||||
|
@ -171,7 +171,7 @@ class TestPyLastNetwork(TestPyLastWithLastFm):
|
|||
tag = self.network.get_tag("blues")
|
||||
|
||||
# Act
|
||||
things = tag.get_top_tracks(limit=2, stream=False)
|
||||
things = tag.get_top_tracks(limit=2)
|
||||
|
||||
# Assert
|
||||
self.helper_two_different_things_in_top_list(things, pylast.Track)
|
||||
|
|
|
@ -94,8 +94,8 @@ class TestPyLastWithLastFm(PyLastTestCase):
|
|||
func = getattr(thing, function_name, None)
|
||||
|
||||
# Act
|
||||
result1 = func(limit=1, cacheable=False, stream=False)
|
||||
result2 = func(limit=1, cacheable=True, stream=False)
|
||||
result1 = func(limit=1, cacheable=False)
|
||||
result2 = func(limit=1, cacheable=True)
|
||||
result3 = list(func(limit=1))
|
||||
|
||||
# Assert
|
||||
|
|
|
@ -143,10 +143,10 @@ class TestPyLastUser(TestPyLastWithLastFm):
|
|||
user = self.network.get_user("test-user")
|
||||
|
||||
# Act/Assert
|
||||
assert len(user.get_loved_tracks(limit=20, stream=False)) == 20
|
||||
assert len(user.get_loved_tracks(limit=100, stream=False)) <= 100
|
||||
assert len(user.get_loved_tracks(limit=None, stream=False)) >= 23
|
||||
assert len(user.get_loved_tracks(limit=0, stream=False)) >= 23
|
||||
assert len(user.get_loved_tracks(limit=20)) == 20
|
||||
assert len(user.get_loved_tracks(limit=100)) <= 100
|
||||
assert len(user.get_loved_tracks(limit=None)) >= 23
|
||||
assert len(user.get_loved_tracks(limit=0)) >= 23
|
||||
|
||||
def test_user_is_hashable(self):
|
||||
# Arrange
|
||||
|
@ -211,7 +211,7 @@ class TestPyLastUser(TestPyLastWithLastFm):
|
|||
lastfm_user = self.network.get_user("RJ")
|
||||
|
||||
# Act
|
||||
things = lastfm_user.get_top_tracks(limit=2, stream=False)
|
||||
things = lastfm_user.get_top_tracks(limit=2)
|
||||
|
||||
# Assert
|
||||
self.helper_two_different_things_in_top_list(things, pylast.Track)
|
||||
|
@ -362,9 +362,7 @@ class TestPyLastUser(TestPyLastWithLastFm):
|
|||
utc_end = calendar.timegm(end.utctimetuple())
|
||||
|
||||
# Act
|
||||
tracks = lastfm_user.get_recent_tracks(
|
||||
time_from=utc_start, time_to=utc_end, stream=False
|
||||
)
|
||||
tracks = lastfm_user.get_recent_tracks(time_from=utc_start, time_to=utc_end)
|
||||
|
||||
# Assert
|
||||
assert len(tracks) == 1
|
||||
|
@ -382,7 +380,7 @@ class TestPyLastUser(TestPyLastWithLastFm):
|
|||
|
||||
# Act
|
||||
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
|
||||
|
@ -469,7 +467,7 @@ class TestPyLastUser(TestPyLastWithLastFm):
|
|||
user = self.network.get_user("bbc6music")
|
||||
|
||||
# Act
|
||||
scrobbles = user.get_track_scrobbles(artist, title, stream=False)
|
||||
scrobbles = user.get_track_scrobbles(artist, title)
|
||||
|
||||
# Assert
|
||||
assert len(scrobbles) > 0
|
||||
|
@ -483,7 +481,7 @@ class TestPyLastUser(TestPyLastWithLastFm):
|
|||
user = self.network.get_user("bbc6music")
|
||||
|
||||
# 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))
|
||||
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",
|
||||
):
|
||||
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