Remove dead or broken Last.fm user functions
This commit is contained in:
parent
2ef88dfd4c
commit
5fd9e4c8c5
|
@ -2489,39 +2489,6 @@ class User(_BaseObject, _Chartable):
|
|||
return self._get_things(
|
||||
"getTopTracks", "track", Track, params, cacheable)
|
||||
|
||||
def compare_with_user(self, user, shared_artists_limit=None):
|
||||
"""
|
||||
Compare this user with another Last.fm user.
|
||||
Returns a sequence:
|
||||
(tasteometer_score, (shared_artist1, shared_artist2, ...))
|
||||
user: A User object or a username string/unicode object.
|
||||
"""
|
||||
|
||||
if isinstance(user, User):
|
||||
user = user.get_name()
|
||||
|
||||
params = self._get_params()
|
||||
if shared_artists_limit:
|
||||
params['limit'] = shared_artists_limit
|
||||
params['type1'] = 'user'
|
||||
params['type2'] = 'user'
|
||||
params['value1'] = self.get_name()
|
||||
params['value2'] = user
|
||||
|
||||
doc = self._request('tasteometer.compare', False, params)
|
||||
|
||||
score = _extract(doc, 'score')
|
||||
|
||||
artists = doc.getElementsByTagName('artists')[0]
|
||||
shared_artists_names = _extract_all(artists, 'name')
|
||||
|
||||
shared_artists_seq = []
|
||||
|
||||
for name in shared_artists_names:
|
||||
shared_artists_seq.append(Artist(name, self.network))
|
||||
|
||||
return (score, shared_artists_seq)
|
||||
|
||||
def get_image(self):
|
||||
"""Returns the user's avatar."""
|
||||
|
||||
|
|
|
@ -85,17 +85,6 @@ class TestPyLastUser(PyLastTestCase):
|
|||
# Just check date because of timezones
|
||||
self.assertEqual(unixtime_registered, u"1037793040")
|
||||
|
||||
def test_get_genderless_user(self):
|
||||
# Arrange
|
||||
# Currently test_user has no gender set:
|
||||
lastfm_user = self.network.get_user("test_user")
|
||||
|
||||
# Act
|
||||
gender = lastfm_user.get_gender()
|
||||
|
||||
# Assert
|
||||
self.assertIsNone(gender)
|
||||
|
||||
def test_get_countryless_user(self):
|
||||
# Arrange
|
||||
# Currently test_user has no country set:
|
||||
|
|
Loading…
Reference in a new issue