本文整理汇总了Python中recipe.configuration.definition.recipe_definition.RecipeDefinition.get_job_types方法的典型用法代码示例。如果您正苦于以下问题:Python RecipeDefinition.get_job_types方法的具体用法?Python RecipeDefinition.get_job_types怎么用?Python RecipeDefinition.get_job_types使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类recipe.configuration.definition.recipe_definition.RecipeDefinition
的用法示例。
在下文中一共展示了RecipeDefinition.get_job_types方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_get_job_types_unique
# 需要导入模块: from recipe.configuration.definition.recipe_definition import RecipeDefinition [as 别名]
# 或者: from recipe.configuration.definition.recipe_definition.RecipeDefinition import get_job_types [as 别名]
def test_get_job_types_unique(self):
"""Tests getting job types without duplicates."""
definition = {
'version': '1.0',
'input_data': [],
'jobs': [{
'name': 'Job 1a',
'job_type': {
'name': self.job_type1.name,
'version': self.job_type1.version,
},
}, {
'name': 'Job 2',
'job_type': {
'name': self.job_type2.name,
'version': self.job_type2.version,
},
}, {
'name': 'Job 1b',
'job_type': {
'name': self.job_type1.name,
'version': self.job_type1.version,
},
}],
}
recipe_definition = RecipeDefinition(definition)
results = recipe_definition.get_job_types()
self.assertSetEqual(results, {self.job_type1, self.job_type2})
示例2: test_get_job_types_empty
# 需要导入模块: from recipe.configuration.definition.recipe_definition import RecipeDefinition [as 别名]
# 或者: from recipe.configuration.definition.recipe_definition.RecipeDefinition import get_job_types [as 别名]
def test_get_job_types_empty(self):
"""Tests getting job types when there are no jobs defined."""
definition = {
'version': '1.0',
'input_data': [],
'jobs': [],
}
recipe_definition = RecipeDefinition(definition)
results = recipe_definition.get_job_types()
self.assertSetEqual(results, set())
示例3: test_get_job_types_one
# 需要导入模块: from recipe.configuration.definition.recipe_definition import RecipeDefinition [as 别名]
# 或者: from recipe.configuration.definition.recipe_definition.RecipeDefinition import get_job_types [as 别名]
def test_get_job_types_one(self):
"""Tests getting a job type from the definition."""
definition = {
'version': '1.0',
'input_data': [],
'jobs': [{
'name': 'Job 1',
'job_type': {
'name': self.job_type1.name,
'version': self.job_type1.version,
},
}],
}
recipe_definition = RecipeDefinition(definition)
results = recipe_definition.get_job_types()
self.assertSetEqual(results, {self.job_type1})
示例4: test_get_job_types_multi
# 需要导入模块: from recipe.configuration.definition.recipe_definition import RecipeDefinition [as 别名]
# 或者: from recipe.configuration.definition.recipe_definition.RecipeDefinition import get_job_types [as 别名]
def test_get_job_types_multi(self):
'''Tests getting job types from the definition.'''
definition = {
'version': '1.0',
'input_data': [],
'jobs': [{
'name': 'Job 1',
'job_type': {
'name': self.job_type1.name,
'version': self.job_type1.version,
},
}, {
'name': 'Job 2',
'job_type': {
'name': self.job_type2.name,
'version': self.job_type2.version,
},
}],
}
recipe_definition = RecipeDefinition(definition)
results = recipe_definition.get_job_types()
self.assertSetEqual(results, {self.job_type1, self.job_type2})