Ejemplo n.º 1
0
def _module_help(module_name, devel):
    try:
        module = importlib.import_module(
            'snapcraft.plugins.{}'.format(module_name))
        if module.__doc__ and devel:
            help(module)
        elif module.__doc__:
            print(module.__doc__)
        else:
            print('The plugin has no documentation')
    except ImportError:
        logger.error('The plugin does not exist. Use one of the following:')
        cmds.list_plugins()
Ejemplo n.º 2
0
def _module_help(module_name, devel):
    try:
        module = importlib.import_module(
            'snapcraft.plugins.{}'.format(module_name))
        if module.__doc__ and devel:
            help(module)
        elif module.__doc__:
            print(module.__doc__)
        else:
            print('The plugin has no documentation')
    except ImportError:
        logger.error('The plugin does not exist. Use one of the following:')
        cmds.list_plugins()
Ejemplo n.º 3
0
    def test_list_plugins(self, mock_stdout):
        expected_list = '''ant
autotools
catkin
cmake
copy
go
jdk
make
maven
python2
python3
qml
roscore
scons
tar-content
'''
        cmds.list_plugins()
        self.assertEqual(mock_stdout.getvalue(), expected_list)
Ejemplo n.º 4
0
    def test_list_plugins(self, mock_stdout):
        expected_list = '''ant
autotools
catkin
cmake
copy
go
jdk
make
maven
python2
python3
qml
roscore
scons
tar-content
'''
        cmds.list_plugins()
        self.assertEqual(mock_stdout.getvalue(), expected_list)