当前位置: 首页>>代码示例>>Python>>正文


Python PluginManager.find_plugins方法代码示例

本文整理汇总了Python中openlp.core.lib.pluginmanager.PluginManager.find_plugins方法的典型用法代码示例。如果您正苦于以下问题:Python PluginManager.find_plugins方法的具体用法?Python PluginManager.find_plugins怎么用?Python PluginManager.find_plugins使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在openlp.core.lib.pluginmanager.PluginManager的用法示例。


在下文中一共展示了PluginManager.find_plugins方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: find_plugins_test

# 需要导入模块: from openlp.core.lib.pluginmanager import PluginManager [as 别名]
# 或者: from openlp.core.lib.pluginmanager.PluginManager import find_plugins [as 别名]
    def find_plugins_test(self):
        """
        Test the find_plugins() method to ensure it imports the correct plugins
        """
        # GIVEN: A plugin manager
        plugin_manager = PluginManager()

        # WHEN: We mock out sys.platform to make it return "darwin" and then find the plugins
        old_platform = sys.platform
        sys.platform = 'darwin'
        plugin_manager.find_plugins()
        sys.platform = old_platform

        # THEN: We should find the "Songs", "Bibles", etc in the plugins list
        plugin_names = [plugin.name for plugin in plugin_manager.plugins]
        self.assertIn('songs', plugin_names, 'There should be a "songs" plugin')
        self.assertIn('bibles', plugin_names, 'There should be a "bibles" plugin')
        self.assertIn('presentations', plugin_names, 'There should be a "presentations" plugin')
        self.assertIn('images', plugin_names, 'There should be a "images" plugin')
        self.assertIn('media', plugin_names, 'There should be a "media" plugin')
        self.assertIn('custom', plugin_names, 'There should be a "custom" plugin')
        self.assertIn('songusage', plugin_names, 'There should be a "songusage" plugin')
        self.assertIn('alerts', plugin_names, 'There should be a "alerts" plugin')
        self.assertIn('remotes', plugin_names, 'There should be a "remotes" plugin')
开发者ID:crossroadchurch,项目名称:paul,代码行数:26,代码来源:test_pluginmanager.py


注:本文中的openlp.core.lib.pluginmanager.PluginManager.find_plugins方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。