diff --git a/mopidy/utils/deps.py b/mopidy/utils/deps.py index 3c177036..480dc180 100644 --- a/mopidy/utils/deps.py +++ b/mopidy/utils/deps.py @@ -35,6 +35,7 @@ def format_dependency_list(adapters=None): pylast_info, dbus_info, serial_info, + cherrypy_info, ] lines = [] @@ -189,3 +190,14 @@ def serial_info(): except ImportError: pass return dep_info + + +def cherrypy_info(): + dep_info = {'name': 'cherrypy'} + try: + import cherrypy + dep_info['version'] = cherrypy.__version__ + dep_info['path'] = cherrypy.__file__ + except ImportError: + pass + return dep_info diff --git a/tests/utils/deps_test.py b/tests/utils/deps_test.py index 168f98e5..d301cc91 100644 --- a/tests/utils/deps_test.py +++ b/tests/utils/deps_test.py @@ -27,6 +27,11 @@ try: except ImportError: spotify = False +try: + import cherrypy +except ImportError: + cherrypy = False + from mopidy.utils import deps from tests import unittest @@ -115,3 +120,11 @@ class DepsTest(unittest.TestCase): self.assertEquals('pyserial', result['name']) self.assertEquals(serial.VERSION, result['version']) self.assertIn('serial', result['path']) + + @unittest.skipUnless(cherrypy, 'cherrypy not found') + def test_cherrypy_info(self): + result = deps.cherrypy_info() + + self.assertEquals('cherrypy', result['name']) + self.assertEquals(cherrypy.__version__, result['version']) + self.assertIn('cherrypy', result['path'])