From 5dcf8a2f70bc46ddf684abacc94033897c745333 Mon Sep 17 00:00:00 2001 From: hugovk Date: Mon, 27 Apr 2015 21:21:20 +0300 Subject: [PATCH 1/3] Remove commented function --- pylast/__init__.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/pylast/__init__.py b/pylast/__init__.py index 51bb5a1..76459ee 100644 --- a/pylast/__init__.py +++ b/pylast/__init__.py @@ -192,19 +192,6 @@ class _Network(object): self.session_key = sk_gen.get_session_key( 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): return "%s Network" % self.name From 615bccb227bcf67b7b95873e6c11df63608df678 Mon Sep 17 00:00:00 2001 From: hugovk Date: Mon, 27 Apr 2015 21:41:16 +0300 Subject: [PATCH 2/3] Remove artist.getImages and depracation note --- pylast/__init__.py | 8 -------- tests/test_pylast.py | 13 ------------- 2 files changed, 21 deletions(-) diff --git a/pylast/__init__.py b/pylast/__init__.py index 76459ee..45d627b 100644 --- a/pylast/__init__.py +++ b/pylast/__init__.py @@ -2077,14 +2077,6 @@ class Artist(_BaseObject, _Taggable): return self.network._get_url( 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): """ Post a shout diff --git a/tests/test_pylast.py b/tests/test_pylast.py index 1574d13..7a3f736 100755 --- a/tests/test_pylast.py +++ b/tests/test_pylast.py @@ -36,11 +36,6 @@ class TestPyLast(unittest.TestCase): 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): return int(time.time()) @@ -762,14 +757,6 @@ class TestPyLast(unittest.TestCase): # Assert 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): # Assert self.assertIsNotNone(a) From 4437508e0f5571a72312a881923ddca1d42c9638 Mon Sep 17 00:00:00 2001 From: hugovk Date: Tue, 28 Apr 2015 23:14:36 +0300 Subject: [PATCH 3/3] Remove unused import --- tests/test_pylast.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/test_pylast.py b/tests/test_pylast.py index 7a3f736..1980e7a 100755 --- a/tests/test_pylast.py +++ b/tests/test_pylast.py @@ -6,7 +6,6 @@ from flaky import flaky import os import pytest from random import choice -import sys import time import unittest