Add Python impl adapter for --list-deps
This commit is contained in:
parent
44b6307046
commit
05c935bc4c
@ -1,4 +1,5 @@
|
||||
import os
|
||||
import platform
|
||||
import sys
|
||||
|
||||
import pygst
|
||||
@ -24,6 +25,7 @@ def list_deps_optparse_callback(*args):
|
||||
def format_dependency_list(adapters=None):
|
||||
if adapters is None:
|
||||
adapters = [
|
||||
python_info,
|
||||
gstreamer_info,
|
||||
pykka_info,
|
||||
pyspotify_info,
|
||||
@ -48,6 +50,15 @@ def format_dependency_list(adapters=None):
|
||||
return '\n'.join(lines)
|
||||
|
||||
|
||||
def python_info():
|
||||
return {
|
||||
'name': 'Python',
|
||||
'version': '%s %s' % (platform.python_implementation(),
|
||||
platform.python_version()),
|
||||
'path': platform.__file__,
|
||||
}
|
||||
|
||||
|
||||
def gstreamer_info():
|
||||
return {
|
||||
'name': 'Gstreamer',
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
import platform
|
||||
|
||||
import pygst
|
||||
pygst.require('0.10')
|
||||
import gst
|
||||
@ -45,6 +47,14 @@ class DepsTest(unittest.TestCase):
|
||||
self.assertNotIn('/baz.py', result)
|
||||
self.assertIn('Quux', result)
|
||||
|
||||
def test_python_info(self):
|
||||
result = deps.python_info()
|
||||
|
||||
self.assertEquals('Python', result['name'])
|
||||
self.assertIn(platform.python_implementation(), result['version'])
|
||||
self.assertIn(platform.python_version(), result['version'])
|
||||
self.assertIn('python', result['path'])
|
||||
|
||||
def test_gstreamer_info(self):
|
||||
result = deps.gstreamer_info()
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user