Ejemplo n.º 1
0
def test_information(system, pyversion, pyimpl):
    """Verify that we return all the information we care about."""
    expected = {
        'version':
        '3.1.0',
        'plugins': [{
            'plugin': 'mccabe',
            'version': '0.5.9'
        }, {
            'plugin': 'pycodestyle',
            'version': '2.0.0'
        }],
        'dependencies': [{
            'dependency': 'setuptools',
            'version': setuptools.__version__
        }],
        'platform': {
            'python_implementation': 'CPython',
            'python_version': '3.5.3',
            'system': 'Linux',
        },
    }
    option_manager = mock.Mock(
        registered_plugins={('pycodestyle', '2.0.0'), ('mccabe', '0.5.9')},
        version='3.1.0',
    )
    assert expected == debug.information(option_manager)
    pyimpl.assert_called_once_with()
    pyversion.assert_called_once_with()
    system.assert_called_once_with()
Ejemplo n.º 2
0
def test_information(system, pyversion, pyimpl):
    """Verify that we return all the information we care about."""
    expected = {
        "version": "3.1.0",
        "plugins": [
            {"plugin": "mccabe", "version": "0.5.9", "is_local": False},
            {"plugin": "pycodestyle", "version": "2.0.0", "is_local": False},
        ],
        "dependencies": [],
        "platform": {
            "python_implementation": "CPython",
            "python_version": "3.5.3",
            "system": "Linux",
        },
    }
    option_manager = mock.Mock(
        registered_plugins={
            manager.PluginVersion("pycodestyle", "2.0.0", False),
            manager.PluginVersion("mccabe", "0.5.9", False),
        },
        version="3.1.0",
    )
    assert expected == debug.information(option_manager)
    pyimpl.assert_called_once_with()
    pyversion.assert_called_once_with()
    system.assert_called_once_with()
Ejemplo n.º 3
0
def test_information(system, pyversion, pyimpl):
    """Verify that we return all the information we care about."""
    expected = {
        'version': '3.1.0',
        'plugins': [{'plugin': 'mccabe', 'version': '0.5.9',
                     'is_local': False},
                    {'plugin': 'pycodestyle', 'version': '2.0.0',
                     'is_local': False}],
        'dependencies': [{'dependency': 'entrypoints',
                          'version': entrypoints.__version__}],
        'platform': {
            'python_implementation': 'CPython',
            'python_version': '3.5.3',
            'system': 'Linux',
        },
    }
    option_manager = mock.Mock(
        registered_plugins={
            manager.PluginVersion('pycodestyle', '2.0.0', False),
            manager.PluginVersion('mccabe', '0.5.9', False),
        },
        version='3.1.0',
    )
    assert expected == debug.information(option_manager)
    pyimpl.assert_called_once_with()
    pyversion.assert_called_once_with()
    system.assert_called_once_with()
Ejemplo n.º 4
0
def test_information(system, pyversion, pyimpl):
    """Verify that we return all the information we care about."""
    expected = {
        'version': '3.1.0',
        'plugins': [{'plugin': 'mccabe', 'version': '0.5.9'},
                    {'plugin': 'pycodestyle', 'version': '2.0.0'}],
        'dependencies': [{'dependency': 'setuptools',
                          'version': setuptools.__version__}],
        'platform': {
            'python_implementation': 'CPython',
            'python_version': '3.5.3',
            'system': 'Linux',
        },
    }
    option_manager = mock.Mock(
        registered_plugins=set([('pycodestyle', '2.0.0'),
                                ('mccabe', '0.5.9')]),
        version='3.1.0',
    )
    assert expected == debug.information(option_manager)
    pyimpl.assert_called_once_with()
    pyversion.assert_called_once_with()
    system.assert_called_once_with()