當前位置: 首頁>>代碼示例>>Python>>正文


Python api.SubmissionDetails類代碼示例

本文整理匯總了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()")
開發者ID:AnalyticsAutomated,項目名稱:analytics_automated,代碼行數:28,代碼來源:test_api_chainconstruction.py

示例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)
開發者ID:AnalyticsAutomated,項目名稱:analytics_automated,代碼行數:7,代碼來源:test_api_unittests.py

示例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()")
開發者ID:AnalyticsAutomated,項目名稱:analytics_automated,代碼行數:27,代碼來源:test_api_chainconstruction.py

示例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()")
開發者ID:AnalyticsAutomated,項目名稱:analytics_automated,代碼行數:28,代碼來源:test_api_chainconstruction.py

示例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)
開發者ID:AnalyticsAutomated,項目名稱:analytics_automated,代碼行數:8,代碼來源:test_api_unittests.py

示例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)
開發者ID:AnalyticsAutomated,項目名稱:analytics_automated,代碼行數:8,代碼來源:test_api_unittests.py

示例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)
開發者ID:AnalyticsAutomated,項目名稱:analytics_automated,代碼行數:8,代碼來源:test_api_unittests.py

示例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)
開發者ID:AnalyticsAutomated,項目名稱:analytics_automated,代碼行數:8,代碼來源:test_api_unittests.py

示例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, '')
開發者ID:AnalyticsAutomated,項目名稱:analytics_automated,代碼行數:8,代碼來源:test_api_unittests.py

示例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)
開發者ID:AnalyticsAutomated,項目名稱:analytics_automated,代碼行數:8,代碼來源:test_api_unittests.py

示例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)
開發者ID:AnalyticsAutomated,項目名稱:analytics_automated,代碼行數:8,代碼來源:test_api_unittests.py

示例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)
開發者ID:AnalyticsAutomated,項目名稱:analytics_automated,代碼行數:9,代碼來源:test_api_unittests.py

示例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)
開發者ID:AnalyticsAutomated,項目名稱:analytics_automated,代碼行數:9,代碼來源:test_api_unittests.py

示例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)
開發者ID:AnalyticsAutomated,項目名稱:analytics_automated,代碼行數:9,代碼來源:test_api_unittests.py

示例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)
開發者ID:AnalyticsAutomated,項目名稱:analytics_automated,代碼行數:10,代碼來源:test_api_unittests.py


注:本文中的analytics_automated.api.SubmissionDetails類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。