Ejemplo n.º 1
0
    def test_format_dependency_list(self):
        adapters = [
            lambda: dict(name='Python', version='FooPython 2.7.3'),
            lambda: dict(name='Platform', version='Loonix 4.0.1'),
            lambda: dict(
                name='Pykka', version='1.1',
                path='/foo/bar/baz.py', other='Quux'),
            lambda: dict(name='Foo'),
            lambda: dict(name='Mopidy', version='0.13', dependencies=[
                dict(name='pylast', version='0.5', dependencies=[
                    dict(name='setuptools', version='0.6')
                ])
            ])
        ]

        result = deps.format_dependency_list(adapters)

        self.assertIn('Python: FooPython 2.7.3', result)

        self.assertIn('Platform: Loonix 4.0.1', result)

        self.assertIn('Pykka: 1.1 from /foo/bar', result)
        self.assertNotIn('/baz.py', result)
        self.assertIn('Detailed information: Quux', result)

        self.assertIn('Foo: not found', result)

        self.assertIn('Mopidy: 0.13', result)
        self.assertIn('  pylast: 0.5', result)
        self.assertIn('    setuptools: 0.6', result)
Ejemplo n.º 2
0
    def test_format_dependency_list(self):
        adapters = [
            lambda: dict(name='Python', version='FooPython 2.7.3'),
            lambda: dict(name='Platform', version='Loonix 4.0.1'),
            lambda: dict(name='Pykka',
                         version='1.1',
                         path='/foo/bar/baz.py',
                         other='Quux'), lambda: dict(name='Foo'),
            lambda: dict(name='Mopidy',
                         version='0.13',
                         dependencies=[
                             dict(name='pylast',
                                  version='0.5',
                                  dependencies=
                                  [dict(name='setuptools', version='0.6')])
                         ])
        ]

        result = deps.format_dependency_list(adapters)

        self.assertIn('Python: FooPython 2.7.3', result)

        self.assertIn('Platform: Loonix 4.0.1', result)

        self.assertIn('Pykka: 1.1 from /foo/bar', result)
        self.assertNotIn('/baz.py', result)
        self.assertIn('Detailed information: Quux', result)

        self.assertIn('Foo: not found', result)

        self.assertIn('Mopidy: 0.13', result)
        self.assertIn('  pylast: 0.5', result)
        self.assertIn('    setuptools: 0.6', result)
Ejemplo n.º 3
0
    def test_format_dependency_list(self):
        adapters = [
            lambda: dict(name='Python', version='FooPython 2.7.3'),
            lambda: dict(name='Platform', version='Loonix 4.0.1'),
            lambda: dict(name='Pykka', path='/foo/bar/baz.py', other='Quux')
        ]

        result = deps.format_dependency_list(adapters)

        self.assertIn('Python: FooPython 2.7.3', result)
        self.assertIn('Platform: Loonix 4.0.1', result)
        self.assertIn('Pykka: not found', result)
        self.assertIn('Imported from: /foo/bar', result)
        self.assertNotIn('/baz.py', result)
        self.assertIn('Quux', result)
Ejemplo n.º 4
0
    def test_format_dependency_list(self):
        adapters = [
            lambda: dict(name="Python", version="FooPython 2.7.3"),
            lambda: dict(name="Platform", version="Loonix 4.0.1"),
            lambda: dict(name="Pykka", path="/foo/bar/baz.py", other="Quux"),
        ]

        result = deps.format_dependency_list(adapters)

        self.assertIn("Python: FooPython 2.7.3", result)
        self.assertIn("Platform: Loonix 4.0.1", result)
        self.assertIn("Pykka: not found", result)
        self.assertIn("Imported from: /foo/bar", result)
        self.assertNotIn("/baz.py", result)
        self.assertIn("Quux", result)
Ejemplo n.º 5
0
    def test_format_dependency_list(self):
        adapters = [
            lambda: dict(name='Python', version='FooPython 2.7.3'),
            lambda: dict(name='Platform', version='Loonix 4.0.1'),
            lambda: dict(name='Pykka', path='/foo/bar/baz.py', other='Quux')
        ]

        result = deps.format_dependency_list(adapters)

        self.assertIn('Python: FooPython 2.7.3', result)
        self.assertIn('Platform: Loonix 4.0.1', result)
        self.assertIn('Pykka: not found', result)
        self.assertIn('Imported from: /foo/bar', result)
        self.assertNotIn('/baz.py', result)
        self.assertIn('Quux', result)
Ejemplo n.º 6
0
 def run(self):
     print(deps.format_dependency_list())
     return 0
Ejemplo n.º 7
0
 def run(self):
     print(deps.format_dependency_list())
     return 0
Ejemplo n.º 8
0
def show_deps():
    """Prints a list of all dependencies and exits."""
    print deps.format_dependency_list()
    sys.exit(0)
Ejemplo n.º 9
0
def show_deps():
    """Prints a list of all dependencies and exits."""
    print deps.format_dependency_list()
    sys.exit(0)