Partial fix for #87
This commit is contained in:
parent
2d42d3b15d
commit
cd10d53a82
|
@ -1496,7 +1496,9 @@ class Artist(_BaseObject, _Taggable):
|
||||||
else:
|
else:
|
||||||
params = None
|
params = None
|
||||||
|
|
||||||
return _extract(self._request("artist.getInfo", True, params), "summary")
|
doc = self._request("artist.getInfo", True, params)
|
||||||
|
|
||||||
|
return doc.getElementsByTagName('summary')[0].firstChild.wholeText.strip()
|
||||||
|
|
||||||
def get_bio_content(self, language=None):
|
def get_bio_content(self, language=None):
|
||||||
"""Returns the content of the artist's biography."""
|
"""Returns the content of the artist's biography."""
|
||||||
|
|
|
@ -675,6 +675,18 @@ class TestPyLast(unittest.TestCase):
|
||||||
self.assertEqual(lastfm_user, loaded_user)
|
self.assertEqual(lastfm_user, loaded_user)
|
||||||
|
|
||||||
|
|
||||||
|
def test_bio_summary(self):
|
||||||
|
# Arrange
|
||||||
|
artist = pylast.Artist("Test Artist", self.network)
|
||||||
|
|
||||||
|
# Act
|
||||||
|
bio = artist.get_bio_summary()
|
||||||
|
|
||||||
|
# Assert
|
||||||
|
self.assertIsNotNone(bio)
|
||||||
|
self.assertGreaterEqual(len(bio), 1)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
||||||
# For quick testing of a single case (eg. test = "test_scrobble")
|
# For quick testing of a single case (eg. test = "test_scrobble")
|
||||||
|
|
Loading…
Reference in a new issue