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()
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)