deps: Don't strip last dir from dependency path

This commit is contained in:
Stein Magnus Jodal 2013-11-02 19:25:06 +01:00
parent 96633e1e83
commit 04d9fa667b
2 changed files with 6 additions and 4 deletions

View File

@ -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),
}

View File

@ -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'])