diff --git a/mopidy/utils/deps.py b/mopidy/utils/deps.py index 99a22d3c..a1adf0a7 100644 --- a/mopidy/utils/deps.py +++ b/mopidy/utils/deps.py @@ -41,7 +41,7 @@ def _format_dependency(dep_info): lines.append('%s: not found' % dep_info['name']) else: if 'path' in dep_info: - source = ' from %s' % os.path.dirname(dep_info['path']) + source = ' from %s' % dep_info['path'] else: source = '' lines.append('%s: %s%s' % ( @@ -75,7 +75,7 @@ def python_info(): 'name': 'Python', 'version': '%s %s' % ( platform.python_implementation(), platform.python_version()), - 'path': platform.__file__, + 'path': os.path.dirname(platform.__file__), } @@ -127,7 +127,7 @@ def gstreamer_info(): return { 'name': 'GStreamer', 'version': '.'.join(map(str, gst.get_gst_version())), - 'path': gst.__file__, + 'path': os.path.dirname(gst.__file__), 'other': '\n'.join(other), } diff --git a/tests/utils/deps_test.py b/tests/utils/deps_test.py index 4ad04ed7..2a25c095 100644 --- a/tests/utils/deps_test.py +++ b/tests/utils/deps_test.py @@ -20,7 +20,7 @@ class DepsTest(unittest.TestCase): lambda: dict(name='Platform', version='Loonix 4.0.1'), lambda: dict( name='Pykka', version='1.1', - path='/foo/bar/baz.py', other='Quux'), + path='/foo/bar', other='Quux'), lambda: dict(name='Foo'), lambda: dict(name='Mopidy', version='0.13', dependencies=[ dict(name='pylast', version='0.5', dependencies=[ @@ -58,6 +58,7 @@ class DepsTest(unittest.TestCase): self.assertIn(platform.python_implementation(), result['version']) self.assertIn(platform.python_version(), result['version']) self.assertIn('python', result['path']) + self.assertNotIn('platform.py', result['path']) def test_gstreamer_info(self): result = deps.gstreamer_info() @@ -66,6 +67,7 @@ class DepsTest(unittest.TestCase): self.assertEquals( '.'.join(map(str, gst.get_gst_version())), result['version']) self.assertIn('gst', result['path']) + self.assertNotIn('__init__.py', result['path']) self.assertIn('Python wrapper: gst-python', result['other']) self.assertIn( '.'.join(map(str, gst.get_pygst_version())), result['other'])