diff --git a/mopidy/http/__init__.py b/mopidy/http/__init__.py index 7689f307..192405db 100644 --- a/mopidy/http/__init__.py +++ b/mopidy/http/__init__.py @@ -73,12 +73,8 @@ class Router(object): if not self.name: raise ValueError('Undefined router name in %s' % self) - def linkify(self): - """ - Absolute URL to the root of this router. - - :return: URL this router is mounted at - """ + def get_root_url(self): + """Get the absolute URL to the root of this router.""" return 'http://%s:%s/%s/' % (self.hostname, self.port, self.name) def setup_routes(self): @@ -94,7 +90,7 @@ class Router(object): if self.static_file_path is None: raise ValueError('Undefined static file path in %s' % self) logger.info( - 'Serving HTTP extension %s at %s', type(self), self.linkify()) + 'Serving HTTP extension %s at %s', type(self), self.get_root_url()) return [ (r'/%s/(.*)' % self.name, StaticFileHandler, { 'path': self.static_file_path, diff --git a/tests/http/test_router.py b/tests/http/test_router.py index 370a140b..08829187 100644 --- a/tests/http/test_router.py +++ b/tests/http/test_router.py @@ -64,7 +64,7 @@ class HttpRouterTest(unittest.TestCase): def test_default_uri_helper(self): router = TestRouter(self.config) - self.assertEqual('http://127.0.0.1:6680/test/', router.linkify()) + self.assertEqual('http://127.0.0.1:6680/test/', router.get_root_url()) class StaticFileHandlerTest(AsyncHTTPTestCase):