本文整理汇总了Python中analytics_automated.api.SubmissionDetails类的典型用法代码示例。如果您正苦于以下问题:Python SubmissionDetails类的具体用法?Python SubmissionDetails怎么用?Python SubmissionDetails使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SubmissionDetails类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test__construct_chain_string_with_ending_group
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_get_job_priority_returns_logged_priority
def test_get_job_priority_returns_logged_priority(self):
self.client.login(username='temporary', password='temporary')
sd = SubmissionDetails()
priority, value = sd._SubmissionDetails__get_job_priority(True,
"127.0.0.1")
self.assertEquals(priority, settings.LOGGED_IN_JOB_PRIORITY)
self.assertEquals(value, 0)
示例3: test__construct_chain_string_high_priority
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()")
示例4: test__ensure_we_pass_more_than_one_option
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()")
示例5: test_get_job_priority_returns_low_priority
def test_get_job_priority_returns_low_priority(self):
for i in range(0, settings.QUEUE_HOG_SIZE):
s = SubmissionFactory.create(ip="127.0.0.1")
sd = SubmissionDetails()
priority, value = sd._SubmissionDetails__get_job_priority(False,
"127.0.0.1")
self.assertEquals(priority, Submission.LOW)
self.assertEquals(value, 10)
示例6: test_params_rejected_with_r_reserved_words
def test_params_rejected_with_r_reserved_words(self):
p1 = ParameterFactory.create(task=self.t, flag="-t", bool_valued=False,
rest_alias="this")
steps = self.j1.steps.all()
sd = SubmissionDetails()
bool = sd._SubmissionDetails__test_params(steps, {'task1_this':
'format.packageInfo'})
self.assertEqual(bool, False)
示例7: test_params_reject_with_unix_commands
def test_params_reject_with_unix_commands(self):
p1 = ParameterFactory.create(task=self.t, flag="-t", bool_valued=False,
rest_alias="this")
steps = self.j1.steps.all()
sd = SubmissionDetails()
bool = sd._SubmissionDetails__test_params(steps, {'task1_this':
'rm'})
self.assertEqual(bool, False)
示例8: test__test_params_returns_true_when_too_many_items_passed
def test__test_params_returns_true_when_too_many_items_passed(self):
p1 = ParameterFactory.create(task=self.t, flag="-t", bool_valued=False,
rest_alias="this")
steps = self.j1.steps.all()
sd = SubmissionDetails()
bool = sd._SubmissionDetails__test_params(steps, {'task1_that': 123,
'task1_this': 69})
self.assertEqual(bool, True)
示例9: test__return_value_empty_string_with_no_value_set
def test__return_value_empty_string_with_no_value_set(self):
p1 = ParameterFactory.create(task=self.t, flag="thingy",
bool_valued=False,
rest_alias="this")
sd = SubmissionDetails()
value = sd._SubmissionDetails__return_value(self.t,
{'task1_this': 456})
self.assertEqual(value, '')
示例10: test__return_value_returns_value_flag
def test__return_value_returns_value_flag(self):
p1 = ParameterFactory.create(task=self.t, flag="VALUE",
bool_valued=False,
rest_alias="this")
sd = SubmissionDetails()
value = sd._SubmissionDetails__return_value(self.t,
{'task1_this': 456})
self.assertEqual(value, 456)
示例11: test_get_job_priority_returns_none_priority
def test_get_job_priority_returns_none_priority(self):
for i in range(0, settings.QUEUE_HARD_LIMIT):
s = SubmissionFactory.create(ip="127.0.0.1")
sd = SubmissionDetails()
priority, value = sd._SubmissionDetails__get_job_priority(False,
"127.0.0.1")
self.assertEquals(priority, None)
self.assertEquals(value, 15)
示例12: test_get_job_priority_returns_logged_lower_priority
def test_get_job_priority_returns_logged_lower_priority(self):
for i in range(0, settings.QUEUE_HOG_SIZE):
s = SubmissionFactory.create(ip="127.0.0.1")
self.client.login(username='temporary', password='temporary')
sd = SubmissionDetails()
priority, value = sd._SubmissionDetails__get_job_priority(True,
"127.0.0.1")
self.assertEquals(priority, settings.LOGGED_IN_JOB_PRIORITY-1)
self.assertEquals(value, 10)
示例13: test_get_job_priority_returns_low_priority_with_unset_hard_limit
def test_get_job_priority_returns_low_priority_with_unset_hard_limit(self):
for i in range(0, settings.QUEUE_HARD_LIMIT):
s = SubmissionFactory.create(ip="127.0.0.1")
with self.settings(QUEUE_HARD_LIMIT=None):
sd = SubmissionDetails()
priority, value = sd._SubmissionDetails__get_job_priority(
False, "127.0.0.1")
self.assertEquals(priority, settings.DEFAULT_JOB_PRIORITY-1)
self.assertEquals(value, 15)
示例14: test_get_job_priority_returns_def_priority_with_unset_hog_size
def test_get_job_priority_returns_def_priority_with_unset_hog_size(self):
for i in range(0, settings.QUEUE_HOG_SIZE):
s = SubmissionFactory.create(ip="127.0.0.1")
with self.settings(QUEUE_HOG_SIZE=None):
sd = SubmissionDetails()
priority, value = sd._SubmissionDetails__get_job_priority(
False, "127.0.0.1")
self.assertEquals(priority, settings.DEFAULT_JOB_PRIORITY)
self.assertEquals(value, 10)
示例15: test__test_params_returns_false_when_set_is_not_complete
def test__test_params_returns_false_when_set_is_not_complete(self):
p1 = ParameterFactory.create(task=self.t, flag="-t", bool_valued=False,
rest_alias="this")
p1 = ParameterFactory.create(task=self.t, flag="-th",
bool_valued=False,
rest_alias="that")
steps = self.j1.steps.all()
sd = SubmissionDetails()
bool = sd._SubmissionDetails__test_params(steps, {'task1_that': 123, })
self.assertEqual(bool, False)