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


Python InstallationInfo.get_cluster_plugins_info方法代码示例

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


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

示例1: test_plugins_info

# 需要导入模块: from nailgun.statistics.fuel_statistics.installation_info import InstallationInfo [as 别名]
# 或者: from nailgun.statistics.fuel_statistics.installation_info.InstallationInfo import get_cluster_plugins_info [as 别名]
    def test_plugins_info(self):
        info = InstallationInfo()

        cluster = self.env.create_cluster(api=False)

        plugin_kwargs = self.env.get_default_plugin_metadata()
        plugin_obj = plugins.Plugin(**plugin_kwargs)

        self.db.add(plugin_obj)
        self.db.flush()

        plugin_kwargs["id"] = plugin_obj.id

        cluster_plugin_kwargs = {"cluster_id": cluster.id, "plugin_id": plugin_obj.id, "enabled": True}
        cluster_plugin = plugins.ClusterPlugins(**cluster_plugin_kwargs)

        self.db.add(cluster_plugin)
        self.db.flush()

        expected_attributes_names = ("id", "name", "version", "releases", "fuel_version", "package_version")

        expected_info = dict(
            [(key, value) for key, value in six.iteritems(plugin_kwargs) if key in expected_attributes_names]
        )

        expected = [expected_info]
        actual = info.get_cluster_plugins_info(cluster)
        self.assertEqual(expected, actual)
开发者ID:gdyuldin,项目名称:fuel-web,代码行数:30,代码来源:test_installation_info.py


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