Fix test_cacheable_user[_artist_tracks]
This commit is contained in:
parent
4aefda5d39
commit
000993c328
|
@ -889,6 +889,7 @@ class _Request(object):
|
||||||
raise MalformedResponseError(self.network, e)
|
raise MalformedResponseError(self.network, e)
|
||||||
|
|
||||||
e = doc.getElementsByTagName('lfm')[0]
|
e = doc.getElementsByTagName('lfm')[0]
|
||||||
|
# logger.debug(doc.toprettyxml())
|
||||||
|
|
||||||
if e.getAttribute('status') != "ok":
|
if e.getAttribute('status') != "ok":
|
||||||
e = doc.getElementsByTagName('error')[0]
|
e = doc.getElementsByTagName('error')[0]
|
||||||
|
@ -2496,17 +2497,13 @@ class User(_BaseObject, _Chartable):
|
||||||
|
|
||||||
class AuthenticatedUser(User):
|
class AuthenticatedUser(User):
|
||||||
def __init__(self, network):
|
def __init__(self, network):
|
||||||
User.__init__(self, "", network)
|
User.__init__(self, network.username, network)
|
||||||
|
|
||||||
def _get_params(self):
|
def _get_params(self):
|
||||||
return {"user": self.get_name()}
|
return {"user": self.get_name()}
|
||||||
|
|
||||||
def get_name(self):
|
def get_name(self):
|
||||||
"""Returns the name of the authenticated user."""
|
"""Returns the name of the authenticated user."""
|
||||||
|
|
||||||
doc = self._request("user.getInfo", True, {"user": ""}) # hack
|
|
||||||
|
|
||||||
self.name = _extract(doc, "name")
|
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ class PyLastTestCase(unittest.TestCase):
|
||||||
self.assertTrue(str.endswith(suffix, start, end))
|
self.assertTrue(str.endswith(suffix, start, end))
|
||||||
|
|
||||||
|
|
||||||
@flaky(max_runs=3, min_passes=1)
|
@flaky(max_runs=1, min_passes=1)
|
||||||
class TestPyLastWithLastFm(PyLastTestCase):
|
class TestPyLastWithLastFm(PyLastTestCase):
|
||||||
|
|
||||||
secrets = None
|
secrets = None
|
||||||
|
|
Loading…
Reference in a new issue