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


Python SubmissionDetails._SubmissionDetails__construct_chain_string方法代码示例

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


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

示例1: test__construct_chain_string_with_ending_group

# 需要导入模块: from analytics_automated.api import SubmissionDetails [as 别名]
# 或者: from analytics_automated.api.SubmissionDetails import _SubmissionDetails__construct_chain_string [as 别名]
    def test__construct_chain_string_with_ending_group(self):
        self.t2 = TaskFactory.create(backend=self.b, name="task2",
                                     executable="rm")
        s = StepFactory(job=self.j1, task=self.t2, ordering=1)
        self.t3 = TaskFactory.create(backend=self.b, name="task3",
                                     executable="diff")
        s = StepFactory(job=self.j1, task=self.t3, ordering=1)

        steps = self.j1.steps.all().select_related('task') \
                       .extra(order_by=['ordering'])
        sd = SubmissionDetails()
        local_id = str(uuid.uuid1())
        request_contents = {}
        chain_str = sd._SubmissionDetails__construct_chain_string(
                    steps, request_contents, local_id, 1)
        # print(chain_str)
        self.assertEqual(chain_str, "chain(task_runner.subtask(('" + local_id +
                                    "', 0, 1, 1, 4, 'task1', [], {}, '', 1, {}), "
                                    "immutable=True, queue='localhost'), "
                                    "group(task_runner.subtask(('" + local_id +
                                    "', 1, 2, 2, 4, 'task2', [], {}, '', 1, {}), "
                                    "immutable=True, queue='localhost'), "
                                    "task_runner.subtask(('" + local_id +
                                    "', 1, 2, 3, 4, 'task3', [], {}, '', 1, {}), "
                                    "immutable=True, queue='localhost')), "
                                    "chord_end.subtask(('" + local_id +
                                    "', 2, 4), immutable=True, "
                                    "queue='localhost'),).apply_async()")
开发者ID:AnalyticsAutomated,项目名称:analytics_automated,代码行数:30,代码来源:test_api_chainconstruction.py

示例2: test__construct_chain_string_high_priority

# 需要导入模块: from analytics_automated.api import SubmissionDetails [as 别名]
# 或者: from analytics_automated.api.SubmissionDetails import _SubmissionDetails__construct_chain_string [as 别名]
    def test__construct_chain_string_high_priority(self):
        p1 = ParameterFactory.create(task=self.t, flag="-t", bool_valued=True,
                                     rest_alias="this")
        p1 = ParameterFactory.create(task=self.t, flag="-th",
                                     bool_valued=False,
                                     rest_alias="that",
                                     default=123,
                                     spacing=True)
        p1 = ParameterFactory.create(task=self.t, flag="VALUE",
                                     bool_valued=False,
                                     rest_alias="other",
                                     default="huh")

        request_contents = {'task1_this': 'True', 'task1_that': 123,
                            'task1_other': 'things'}
        steps = self.j1.steps.all().select_related('task') \
                       .extra(order_by=['ordering'])
        sd = SubmissionDetails()
        local_id = str(uuid.uuid1())
        chain_str = sd._SubmissionDetails__construct_chain_string(
                    steps, request_contents, local_id, 2)
        self.assertEqual(chain_str, "chain(task_runner.subtask(('" + local_id +
                                    "', 0, 1, 1, 1, 'task1', ['-t', '-th'], "
                                    "{'-th': {'spacing': True, "
                                    "'switchless': False, 'value': 123}}, "
                                    "'things', 1, {}), immutable=True, "
                                    "queue='high_localhost'),).apply_async()")
开发者ID:AnalyticsAutomated,项目名称:analytics_automated,代码行数:29,代码来源:test_api_chainconstruction.py

示例3: test__ensure_we_pass_more_than_one_option

# 需要导入模块: from analytics_automated.api import SubmissionDetails [as 别名]
# 或者: from analytics_automated.api.SubmissionDetails import _SubmissionDetails__construct_chain_string [as 别名]
    def test__ensure_we_pass_more_than_one_option(self):
        p1 = ParameterFactory.create(task=self.t, flag="-th",
                                     bool_valued=False,
                                     rest_alias="that",
                                     default=123,
                                     spacing=True)
        p1 = ParameterFactory.create(task=self.t, flag="-ch",
                                     bool_valued=False,
                                     rest_alias="chain",
                                     default="CU",
                                     spacing=True)

        request_contents = {'task1_chain': 'AS', 'task1_that': 123, }
        steps = self.j1.steps.all().select_related('task') \
                       .extra(order_by=['ordering'])
        sd = SubmissionDetails()
        local_id = str(uuid.uuid1())
        chain_str = sd._SubmissionDetails__construct_chain_string(
                    steps, request_contents, local_id, 1)
        # print(chain_str)
        self.assertEqual(chain_str, "chain(task_runner.subtask(('" + local_id +
                                    "', 0, 1, 1, 1, 'task1', ['-th', '-ch'], "
                                    "{'-ch': {'spacing': True, "
                                    "'switchless': False, 'value': 'AS'}, "
                                    "'-th': {'spacing': True, "
                                    "'switchless': False, 'value': 123}}, "
                                    "'', 1, {}), immutable=True, "
                                    "queue='localhost'),).apply_async()")
开发者ID:AnalyticsAutomated,项目名称:analytics_automated,代码行数:30,代码来源:test_api_chainconstruction.py


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