本文整理汇总了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)