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


Python Action.get_all方法代码示例

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


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

示例1: test_register_all_actions

# 需要导入模块: from st2common.persistence.action import Action [as 别名]
# 或者: from st2common.persistence.action.Action import get_all [as 别名]
 def test_register_all_actions(self):
     try:
         packs_base_path = os.path.join(tests_base.get_fixtures_path())
         all_actions_in_db = Action.get_all()
         actions_registrar.register_actions(packs_base_path=packs_base_path)
         all_actions_in_db = Action.get_all()
         self.assertTrue(len(all_actions_in_db) > 0)
     except Exception as e:
         print(str(e))
         self.fail('All actions must be registered without exceptions.')
开发者ID:bjoernbessert,项目名称:st2,代码行数:12,代码来源:test_actions_registrar.py

示例2: test_register_all_actions

# 需要导入模块: from st2common.persistence.action import Action [as 别名]
# 或者: from st2common.persistence.action.Action import get_all [as 别名]
 def test_register_all_actions(self):
     try:
         packs_base_path = fixtures_loader.get_fixtures_base_path()
         all_actions_in_db = Action.get_all()
         actions_registrar.register_actions(packs_base_paths=[packs_base_path])
     except Exception as e:
         print(str(e))
         self.fail('All actions must be registered without exceptions.')
     else:
         all_actions_in_db = Action.get_all()
         self.assertTrue(len(all_actions_in_db) > 0)
开发者ID:LindsayHill,项目名称:st2,代码行数:13,代码来源:test_actions_registrar.py

示例3: test_register_all_actions

# 需要导入模块: from st2common.persistence.action import Action [as 别名]
# 或者: from st2common.persistence.action.Action import get_all [as 别名]
    def test_register_all_actions(self):
        try:
            packs_base_path = fixtures_loader.get_fixtures_base_path()
            all_actions_in_db = Action.get_all()
            actions_registrar.register_actions(packs_base_paths=[packs_base_path])
        except Exception as e:
            print(six.text_type(e))
            self.fail('All actions must be registered without exceptions.')
        else:
            all_actions_in_db = Action.get_all()
            self.assertTrue(len(all_actions_in_db) > 0)

        # Assert metadata_file field is populated
        expected_path = 'actions/action-with-no-parameters.yaml'
        self.assertEqual(all_actions_in_db[0].metadata_file, expected_path)
开发者ID:StackStorm,项目名称:st2,代码行数:17,代码来源:test_actions_registrar.py

示例4: get_all

# 需要导入模块: from st2common.persistence.action import Action [as 别名]
# 或者: from st2common.persistence.action.Action import get_all [as 别名]
    def get_all(self, **kwargs):
        """
            List all actions.

            Handles requests:
                GET /actions/views/overview
        """
        LOG.info('GET all /actions/views/overview with filters=%s', kwargs)
        kwargs = self._get_filters(**kwargs)
        action_dbs = Action.get_all(**kwargs)
        action_apis = [ActionAPI.from_model(action_db) for action_db in action_dbs]
        return map(self._transform_action_api, action_apis)
开发者ID:bjoernbessert,项目名称:st2,代码行数:14,代码来源:actionviews.py


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