Fix test_cacheable_user[_artist_tracks]

This commit is contained in:
Hugo 2018-05-27 20:14:13 +03:00
parent 4aefda5d39
commit 000993c328
2 changed files with 3 additions and 6 deletions

View file

@ -889,6 +889,7 @@ class _Request(object):
raise MalformedResponseError(self.network, e)
e = doc.getElementsByTagName('lfm')[0]
# logger.debug(doc.toprettyxml())
if e.getAttribute('status') != "ok":
e = doc.getElementsByTagName('error')[0]
@ -2496,17 +2497,13 @@ class User(_BaseObject, _Chartable):
class AuthenticatedUser(User):
def __init__(self, network):
User.__init__(self, "", network)
User.__init__(self, network.username, network)
def _get_params(self):
return {"user": self.get_name()}
def get_name(self):
"""Returns the name of the authenticated user."""
doc = self._request("user.getInfo", True, {"user": ""}) # hack
self.name = _extract(doc, "name")
return self.name

View file

@ -39,7 +39,7 @@ class PyLastTestCase(unittest.TestCase):
self.assertTrue(str.endswith(suffix, start, end))
@flaky(max_runs=3, min_passes=1)
@flaky(max_runs=1, min_passes=1)
class TestPyLastWithLastFm(PyLastTestCase):
secrets = None