From f70254b9473bc133e4138e1c4680df6c4ed3a72d Mon Sep 17 00:00:00 2001 From: hugovk Date: Wed, 18 Oct 2017 22:31:15 +0300 Subject: [PATCH] Remove dead Last.fm tag search --- pylast/__init__.py | 27 --------------------------- tests/test_pylast_network.py | 12 ------------ 2 files changed, 39 deletions(-) diff --git a/pylast/__init__.py b/pylast/__init__.py index 333768b..0470a17 100644 --- a/pylast/__init__.py +++ b/pylast/__init__.py @@ -445,12 +445,6 @@ class _Network(object): return ArtistSearch(artist_name, self) - def search_for_tag(self, tag_name): - """Searches of a tag by its name. Returns a TagSearch object. - Use get_next_page() to retrieve sequences of results.""" - - return TagSearch(tag_name, self) - def search_for_track(self, artist_name, track_name): """Searches of a track by its name and its artist. Set artist to an empty string if not available. @@ -2729,27 +2723,6 @@ class ArtistSearch(_Search): return seq -class TagSearch(_Search): - """Search for a tag by tag name.""" - - def __init__(self, tag_name, network): - - _Search.__init__(self, "tag", {"tag": tag_name}, network) - - def get_next_page(self): - """Returns the next page of results as a sequence of Tag objects.""" - - master_node = self._retrieve_next_page() - - seq = [] - for node in master_node.getElementsByTagName("tag"): - tag = Tag(_extract(node, "name"), self.network) - tag.tag_count = _number(_extract(node, "count")) - seq.append(tag) - - return seq - - class TrackSearch(_Search): """ Search for a track by track title. If you don't want to narrow the results diff --git a/tests/test_pylast_network.py b/tests/test_pylast_network.py index 04037f4..7ea6432 100755 --- a/tests/test_pylast_network.py +++ b/tests/test_pylast_network.py @@ -340,18 +340,6 @@ class TestPyLastNetwork(PyLastTestCase): self.assertIsInstance(results, list) self.assertIsInstance(results[0], pylast.Artist) - def test_tag_search(self): - # Arrange - tag = "rock" - - # Act - search = self.network.search_for_tag(tag) - results = search.get_next_page() - - # Assert - self.assertIsInstance(results, list) - self.assertIsInstance(results[0], pylast.Tag) - def test_track_search(self): # Arrange artist = "Nirvana"