diff --git a/pylast/__init__.py b/pylast/__init__.py index 896f440..2c316df 100644 --- a/pylast/__init__.py +++ b/pylast/__init__.py @@ -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 diff --git a/tests/test_pylast.py b/tests/test_pylast.py index 2bee953..5321bab 100755 --- a/tests/test_pylast.py +++ b/tests/test_pylast.py @@ -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