From 5f69aa591cbaff4ba16bae6a220f3ad993746b3c Mon Sep 17 00:00:00 2001 From: hugovk Date: Mon, 7 Apr 2014 11:49:40 +0300 Subject: [PATCH] Add cacheable parameter to get_neighbours() --- pylast.py | 4 ++-- test_pylast.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pylast.py b/pylast.py index 8d82548..cacff7e 100644 --- a/pylast.py +++ b/pylast.py @@ -3281,14 +3281,14 @@ class User(_BaseObject, _Chartable): return seq - def get_neighbours(self, limit=50): + def get_neighbours(self, limit=50, cacheable=True): """Returns a list of the user's friends.""" params = self._get_params() if limit: params['limit'] = limit - doc = self._request(self.ws_prefix + '.getNeighbours', True, params) + doc = self._request(self.ws_prefix + '.getNeighbours', cacheable, params) seq = [] names = _extract_all(doc, 'name') diff --git a/test_pylast.py b/test_pylast.py index 6ec8d91..91a943b 100755 --- a/test_pylast.py +++ b/test_pylast.py @@ -846,6 +846,7 @@ class TestPyLast(unittest.TestCase): # Act/Assert self.helper_validate_cacheable(lastfm_user, "get_friends") self.helper_validate_cacheable(lastfm_user, "get_loved_tracks") + self.helper_validate_cacheable(lastfm_user, "get_neighbours") self.helper_validate_cacheable(lastfm_user, "get_past_events") self.helper_validate_cacheable(lastfm_user, "get_recent_tracks") self.helper_validate_cacheable(lastfm_user, "get_recommended_artists")