Merge pull request #130 from hugovk/develop
Remove artist.getImages and deprecation note
This commit is contained in:
commit
d3edfd99cc
|
@ -192,19 +192,6 @@ class _Network(object):
|
||||||
self.session_key = sk_gen.get_session_key(
|
self.session_key = sk_gen.get_session_key(
|
||||||
self.username, self.password_hash)
|
self.username, self.password_hash)
|
||||||
|
|
||||||
"""def __repr__(self):
|
|
||||||
attributes = ("name", "homepage", "ws_server", "api_key", "api_secret",
|
|
||||||
"session_key", "submission_server", "username", "password_hash",
|
|
||||||
"domain_names", "urls")
|
|
||||||
|
|
||||||
text = "pylast._Network(%s)"
|
|
||||||
args = []
|
|
||||||
for attr in attributes:
|
|
||||||
args.append("=".join((attr, repr(getattr(self, attr)))))
|
|
||||||
|
|
||||||
return text % ", ".join(args)
|
|
||||||
"""
|
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return "%s Network" % self.name
|
return "%s Network" % self.name
|
||||||
|
|
||||||
|
@ -2090,14 +2077,6 @@ class Artist(_BaseObject, _Taggable):
|
||||||
return self.network._get_url(
|
return self.network._get_url(
|
||||||
domain_name, "artist") % {'artist': artist}
|
domain_name, "artist") % {'artist': artist}
|
||||||
|
|
||||||
def get_images(self, order=IMAGES_ORDER_POPULARITY, limit=None):
|
|
||||||
"""
|
|
||||||
The artist.getImages method has been deprecated by Last.fm.
|
|
||||||
"""
|
|
||||||
raise WSError(
|
|
||||||
self.network, "27",
|
|
||||||
"The artist.getImages method has been deprecated by Last.fm.")
|
|
||||||
|
|
||||||
def shout(self, message):
|
def shout(self, message):
|
||||||
"""
|
"""
|
||||||
Post a shout
|
Post a shout
|
||||||
|
|
|
@ -6,7 +6,6 @@ from flaky import flaky
|
||||||
import os
|
import os
|
||||||
import pytest
|
import pytest
|
||||||
from random import choice
|
from random import choice
|
||||||
import sys
|
|
||||||
import time
|
import time
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
|
@ -36,11 +35,6 @@ class TestPyLast(unittest.TestCase):
|
||||||
|
|
||||||
secrets = None
|
secrets = None
|
||||||
|
|
||||||
# To remove Python 3's
|
|
||||||
# "DeprecationWarning: Please use assertRaisesRegex instead"
|
|
||||||
if sys.version_info[0] == 2:
|
|
||||||
assertRaisesRegex = unittest.TestCase.assertRaisesRegexp
|
|
||||||
|
|
||||||
def unix_timestamp(self):
|
def unix_timestamp(self):
|
||||||
return int(time.time())
|
return int(time.time())
|
||||||
|
|
||||||
|
@ -762,14 +756,6 @@ class TestPyLast(unittest.TestCase):
|
||||||
# Assert
|
# Assert
|
||||||
self.assertEqual(name, "Last.fm Network")
|
self.assertEqual(name, "Last.fm Network")
|
||||||
|
|
||||||
def test_artist_get_images_deprecated(self):
|
|
||||||
# Arrange
|
|
||||||
artist = self.network.get_artist("Test Artist")
|
|
||||||
|
|
||||||
# Act/Assert
|
|
||||||
with self.assertRaisesRegex(pylast.WSError, 'deprecated'):
|
|
||||||
artist.get_images()
|
|
||||||
|
|
||||||
def helper_validate_results(self, a, b, c):
|
def helper_validate_results(self, a, b, c):
|
||||||
# Assert
|
# Assert
|
||||||
self.assertIsNotNone(a)
|
self.assertIsNotNone(a)
|
||||||
|
|
Loading…
Reference in a new issue