本文整理汇总了Python中st2tests.fixturesloader.FixturesLoader.load_fixtures方法的典型用法代码示例。如果您正苦于以下问题:Python FixturesLoader.load_fixtures方法的具体用法?Python FixturesLoader.load_fixtures怎么用?Python FixturesLoader.load_fixtures使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类st2tests.fixturesloader.FixturesLoader
的用法示例。
在下文中一共展示了FixturesLoader.load_fixtures方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUpClass
# 需要导入模块: from st2tests.fixturesloader import FixturesLoader [as 别名]
# 或者: from st2tests.fixturesloader.FixturesLoader import load_fixtures [as 别名]
def setUpClass(cls):
super(TestTimersHolder, cls).setUpClass()
loader = FixturesLoader()
TestTimersHolder.MODELS = loader.load_fixtures(
fixtures_pack=PACK, fixtures_dict=FIXTURES)['triggers']
loader.save_fixtures_to_db(fixtures_pack=PACK, fixtures_dict=FIXTURES)
示例2: test_create_trigger_db_from_rule_duplicate
# 需要导入模块: from st2tests.fixturesloader import FixturesLoader [as 别名]
# 或者: from st2tests.fixturesloader.FixturesLoader import load_fixtures [as 别名]
def test_create_trigger_db_from_rule_duplicate(self):
test_fixtures = {
'rules': ['cron_timer_rule_1.yaml', 'cron_timer_rule_2.yaml']
}
loader = FixturesLoader()
fixtures = loader.load_fixtures(fixtures_pack='generic', fixtures_dict=test_fixtures)
rules = fixtures['rules']
trigger_db_ret_1 = trigger_service.create_trigger_db_from_rule(
RuleAPI(**rules['cron_timer_rule_1.yaml']))
self.assertTrue(trigger_db_ret_1 is not None)
trigger_db_ret_2 = trigger_service.create_trigger_db_from_rule(
RuleAPI(**rules['cron_timer_rule_2.yaml']))
self.assertTrue(trigger_db_ret_2 is not None)
self.assertEqual(trigger_db_ret_1, trigger_db_ret_2, 'Should reuse same trigger.')
trigger_db = Trigger.get_by_id(trigger_db_ret_1.id)
self.assertDictEqual(trigger_db.parameters,
rules['cron_timer_rule_1.yaml']['trigger']['parameters'])
示例3: FixturesLoader
# 需要导入模块: from st2tests.fixturesloader import FixturesLoader [as 别名]
# 或者: from st2tests.fixturesloader.FixturesLoader import load_fixtures [as 别名]
WF_INVALID_YAQL_FILE
],
'actions': [
'a1.yaml',
'a2.yaml',
'action1.yaml'
],
'runners': [
'testrunner1.yaml',
'testrunner2.yaml'
]
}
PACK = 'generic'
LOADER = FixturesLoader()
FIXTURES = LOADER.load_fixtures(fixtures_pack=PACK, fixtures_dict=TEST_FIXTURES)
WB_PRE_XFORM_PATH = LOADER.get_fixture_file_path_abs(PACK, 'workflows', WB_PRE_XFORM_FILE)
WB_INVALID_SYNTAX_PATH = LOADER.get_fixture_file_path_abs(PACK, 'workflows', WB_INVALID_SYNTAX_FILE)
WB_INVALID_YAQL_PATH = LOADER.get_fixture_file_path_abs(PACK, 'workflows', WB_INVALID_YAQL_FILE)
WF_PRE_XFORM_PATH = LOADER.get_fixture_file_path_abs(PACK, 'workflows', WF_PRE_XFORM_FILE)
WF_NO_REQ_PARAM_PATH = LOADER.get_fixture_file_path_abs(PACK, 'workflows', WF_NO_REQ_PARAM_FILE)
WF_UNEXP_PARAM_PATH = LOADER.get_fixture_file_path_abs(PACK, 'workflows', WF_UNEXP_PARAM_FILE)
WF_INVALID_SYNTAX_PATH = LOADER.get_fixture_file_path_abs(PACK, 'workflows', WF_INVALID_SYNTAX_FILE)
WF_INVALID_YAQL_PATH = LOADER.get_fixture_file_path_abs(PACK, 'workflows', WF_INVALID_YAQL_FILE)
class MistralValidationControllerTest(FunctionalTest):
@classmethod
def setUpClass(cls):
super(MistralValidationControllerTest, cls).setUpClass()