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