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


Python SubmissionDetails._SubmissionDetails__get_job_priority方法代碼示例

本文整理匯總了Python中analytics_automated.api.SubmissionDetails._SubmissionDetails__get_job_priority方法的典型用法代碼示例。如果您正苦於以下問題:Python SubmissionDetails._SubmissionDetails__get_job_priority方法的具體用法?Python SubmissionDetails._SubmissionDetails__get_job_priority怎麽用?Python SubmissionDetails._SubmissionDetails__get_job_priority使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在analytics_automated.api.SubmissionDetails的用法示例。


在下文中一共展示了SubmissionDetails._SubmissionDetails__get_job_priority方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_get_job_priority_returns_logged_priority

# 需要導入模塊: from analytics_automated.api import SubmissionDetails [as 別名]
# 或者: from analytics_automated.api.SubmissionDetails import _SubmissionDetails__get_job_priority [as 別名]
 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,代碼行數:9,代碼來源:test_api_unittests.py

示例2: test_get_job_priority_returns_none_priority

# 需要導入模塊: from analytics_automated.api import SubmissionDetails [as 別名]
# 或者: from analytics_automated.api.SubmissionDetails import _SubmissionDetails__get_job_priority [as 別名]
 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,代碼行數:10,代碼來源:test_api_unittests.py

示例3: test_get_job_priority_returns_low_priority

# 需要導入模塊: from analytics_automated.api import SubmissionDetails [as 別名]
# 或者: from analytics_automated.api.SubmissionDetails import _SubmissionDetails__get_job_priority [as 別名]
 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,代碼行數:10,代碼來源:test_api_unittests.py

示例4: test_get_job_priority_returns_logged_lower_priority

# 需要導入模塊: from analytics_automated.api import SubmissionDetails [as 別名]
# 或者: from analytics_automated.api.SubmissionDetails import _SubmissionDetails__get_job_priority [as 別名]
 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,代碼行數:11,代碼來源:test_api_unittests.py

示例5: test_get_job_priority_returns_def_priority_with_unset_hog_size

# 需要導入模塊: from analytics_automated.api import SubmissionDetails [as 別名]
# 或者: from analytics_automated.api.SubmissionDetails import _SubmissionDetails__get_job_priority [as 別名]
 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,代碼行數:11,代碼來源:test_api_unittests.py

示例6: test_get_job_priority_returns_low_priority_with_unset_hard_limit

# 需要導入模塊: from analytics_automated.api import SubmissionDetails [as 別名]
# 或者: from analytics_automated.api.SubmissionDetails import _SubmissionDetails__get_job_priority [as 別名]
 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,代碼行數:11,代碼來源:test_api_unittests.py

示例7: test_get_job_priority_returns_default_priority

# 需要導入模塊: from analytics_automated.api import SubmissionDetails [as 別名]
# 或者: from analytics_automated.api.SubmissionDetails import _SubmissionDetails__get_job_priority [as 別名]
 def test_get_job_priority_returns_default_priority(self):
     sd = SubmissionDetails()
     priority, value = sd._SubmissionDetails__get_job_priority(False,
                                                               "127.0.0.1")
     self.assertEquals(priority, settings.DEFAULT_JOB_PRIORITY)
     self.assertEquals(value, 0)
開發者ID:AnalyticsAutomated,項目名稱:analytics_automated,代碼行數:8,代碼來源:test_api_unittests.py


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