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