本文整理匯總了Python中treemap.audit.ReputationMetric.apply_adjustment方法的典型用法代碼示例。如果您正苦於以下問題:Python ReputationMetric.apply_adjustment方法的具體用法?Python ReputationMetric.apply_adjustment怎麽用?Python ReputationMetric.apply_adjustment使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類treemap.audit.ReputationMetric
的用法示例。
在下文中一共展示了ReputationMetric.apply_adjustment方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_reputation_metric_no_adjustment_for_no_rm_record
# 需要導入模塊: from treemap.audit import ReputationMetric [as 別名]
# 或者: from treemap.audit.ReputationMetric import apply_adjustment [as 別名]
def test_reputation_metric_no_adjustment_for_no_rm_record(self):
audit = Audit(model='Plot', model_id=1,
action=Audit.Type.Insert,
instance=self.instance, field='readonly',
previous_value=None,
current_value=True,
user=self.privileged_user)
ReputationMetric.apply_adjustment(audit)
self.assertEqual(0,
self.privileged_user.get_reputation(self.instance))
示例2: test_reputation_metric_positive_adjustment_for_rm
# 需要導入模塊: from treemap.audit import ReputationMetric [as 別名]
# 或者: from treemap.audit.ReputationMetric import apply_adjustment [as 別名]
def test_reputation_metric_positive_adjustment_for_rm(self):
self.assertEqual(0,
self.unprivileged_user.get_reputation(self.instance))
audit = Audit(model='Tree', model_id=1,
action=Audit.Type.Insert,
instance=self.instance, field='readonly',
previous_value=None,
current_value=True,
user=self.unprivileged_user)
ReputationMetric.apply_adjustment(audit)
self.assertEqual(2,
self.unprivileged_user.get_reputation(self.instance))