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


Python ClusterPlugins.get_connected_plugins方法代码示例

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


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

示例1: test_get_connected_for_specific_plugins

# 需要导入模块: from nailgun.objects import ClusterPlugins [as 别名]
# 或者: from nailgun.objects.ClusterPlugins import get_connected_plugins [as 别名]
 def test_get_connected_for_specific_plugins(self):
     plugin_ids = self._create_test_plugins()
     cluster = self._create_test_cluster()
     number_of_connected_plugins =\
         ClusterPlugins.get_connected_plugins(
             cluster, plugin_ids[1:]).count()
     self.assertEqual(4, number_of_connected_plugins)
开发者ID:vangogh-ken,项目名称:fuel-web,代码行数:9,代码来源:test_object_plugin.py

示例2: test_is_plugin_used

# 需要导入模块: from nailgun.objects import ClusterPlugins [as 别名]
# 或者: from nailgun.objects.ClusterPlugins import get_connected_plugins [as 别名]
    def test_is_plugin_used(self):
        self._create_test_plugins()
        cluster = self._create_test_cluster()

        plugin = ClusterPlugins.get_connected_plugins(cluster).first()
        self.assertFalse(ClusterPlugins.is_plugin_used(plugin.id))
        ClusterPlugins.set_attributes(cluster.id, plugin.id, enabled=True)
        self.assertTrue(ClusterPlugins.is_plugin_used(plugin.id))
开发者ID:vangogh-ken,项目名称:fuel-web,代码行数:10,代码来源:test_object_plugin.py

示例3: test_get_enabled

# 需要导入模块: from nailgun.objects import ClusterPlugins [as 别名]
# 或者: from nailgun.objects.ClusterPlugins import get_connected_plugins [as 别名]
    def test_get_enabled(self):
        self._create_test_plugins()
        cluster = self._create_test_cluster()

        plugin = ClusterPlugins.get_connected_plugins(cluster).first()
        ClusterPlugins.set_attributes(cluster.id, plugin.id, enabled=True)

        enabled_plugin = ClusterPlugins.get_enabled(cluster.id).first()
        self.assertEqual(plugin.id, enabled_plugin.id)
开发者ID:vangogh-ken,项目名称:fuel-web,代码行数:11,代码来源:test_object_plugin.py

示例4: test_get_enabled

# 需要导入模块: from nailgun.objects import ClusterPlugins [as 别名]
# 或者: from nailgun.objects.ClusterPlugins import get_connected_plugins [as 别名]
    def test_get_enabled(self):
        self._create_test_plugins()
        cluster = self._create_test_cluster()

        plugin_id = ClusterPlugins.get_connected_plugins(cluster.id)[0][0]
        ClusterPlugins.set_attributes(cluster.id, plugin_id, enabled=True)

        enabled_plugin = ClusterPlugins.get_enabled(cluster.id)[0].id
        self.assertEqual(enabled_plugin, plugin_id)
开发者ID:gitfred,项目名称:fuel-web,代码行数:11,代码来源:test_object_plugin.py

示例5: test_set_plugin_attributes

# 需要导入模块: from nailgun.objects import ClusterPlugins [as 别名]
# 或者: from nailgun.objects.ClusterPlugins import get_connected_plugins [as 别名]
    def test_set_plugin_attributes(self):
        meta = base.reflect_db_metadata()
        self._create_test_plugins()
        cluster = self._create_test_cluster()

        plugin = ClusterPlugins.get_connected_plugins(cluster).first()
        ClusterPlugins.set_attributes(cluster.id, plugin.id, enabled=True)

        columns = meta.tables['cluster_plugins'].c
        enabled = self.db.execute(
            sa.select([columns.enabled])
            .where(columns.cluster_id == cluster.id)
            .where(columns.plugin_id == plugin.id)
        ).fetchone()
        self.assertTrue(enabled[0])
开发者ID:vangogh-ken,项目名称:fuel-web,代码行数:17,代码来源:test_object_plugin.py

示例6: test_get_all_connected_plugins

# 需要导入模块: from nailgun.objects import ClusterPlugins [as 别名]
# 或者: from nailgun.objects.ClusterPlugins import get_connected_plugins [as 别名]
 def test_get_all_connected_plugins(self):
     self._create_test_plugins()
     cluster = self._create_test_cluster()
     number_of_connected_plugins =\
         ClusterPlugins.get_connected_plugins(cluster).count()
     self.assertEqual(5, number_of_connected_plugins)
开发者ID:vangogh-ken,项目名称:fuel-web,代码行数:8,代码来源:test_object_plugin.py

示例7: test_get_connected_plugins

# 需要导入模块: from nailgun.objects import ClusterPlugins [as 别名]
# 或者: from nailgun.objects.ClusterPlugins import get_connected_plugins [as 别名]
 def test_get_connected_plugins(self):
     self._create_test_plugins()
     cluster = self._create_test_cluster()
     connected_plugins =\
         ClusterPlugins.get_connected_plugins(cluster.id).all()
     self.assertEqual(len(connected_plugins), 5)
开发者ID:gitfred,项目名称:fuel-web,代码行数:8,代码来源:test_object_plugin.py


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