本文整理匯總了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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)