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


Python RecipeDefinition.get_job_types方法代码示例

本文整理汇总了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})
开发者ID:AppliedIS,项目名称:scale,代码行数:32,代码来源:test_recipe_definition.py

示例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())
开发者ID:AppliedIS,项目名称:scale,代码行数:14,代码来源:test_recipe_definition.py

示例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})
开发者ID:AppliedIS,项目名称:scale,代码行数:20,代码来源:test_recipe_definition.py

示例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})
开发者ID:cshamis,项目名称:scale,代码行数:26,代码来源:test_recipe_definition.py


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