本文整理汇总了Python中the_tale.game.bills.prototypes.VotePrototype.votes_for_count方法的典型用法代码示例。如果您正苦于以下问题:Python VotePrototype.votes_for_count方法的具体用法?Python VotePrototype.votes_for_count怎么用?Python VotePrototype.votes_for_count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类the_tale.game.bills.prototypes.VotePrototype
的用法示例。
在下文中一共展示了VotePrototype.votes_for_count方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_votes_for_count
# 需要导入模块: from the_tale.game.bills.prototypes import VotePrototype [as 别名]
# 或者: from the_tale.game.bills.prototypes.VotePrototype import votes_for_count [as 别名]
def test_votes_for_count(self):
VotePrototype.create(self.account2, self.bill, relations.VOTE_TYPE.AGAINST)
VotePrototype.create(self.account3, self.bill, relations.VOTE_TYPE.REFRAINED)
self.assertEqual(VotePrototype.votes_for_count(self.account1.id), 1)
self.assertEqual(VotePrototype.votes_for_count(self.account2.id), 0)
self.assertEqual(VotePrototype.votes_for_count(self.account3.id), 0)
self.assertEqual(VotePrototype.votes_for_count(self.account4.id), 0)
示例2: get_achievement_type_value
# 需要导入模块: from the_tale.game.bills.prototypes import VotePrototype [as 别名]
# 或者: from the_tale.game.bills.prototypes.VotePrototype import votes_for_count [as 别名]
def get_achievement_type_value(self, achievement_type):
from the_tale.game.bills.prototypes import BillPrototype, VotePrototype
if achievement_type.is_POLITICS_ACCEPTED_BILLS:
return BillPrototype.accepted_bills_count(self.id)
elif achievement_type.is_POLITICS_VOTES_TOTAL:
return VotePrototype.votes_count(self.id)
elif achievement_type.is_POLITICS_VOTES_FOR:
return VotePrototype.votes_for_count(self.id)
elif achievement_type.is_POLITICS_VOTES_AGAINST:
return VotePrototype.votes_against_count(self.id)
elif achievement_type.is_KEEPER_MIGHT:
return self.might
raise exceptions.UnkwnownAchievementTypeError(achievement_type=achievement_type)