def testBorda(self): ranks = [[0, 1, 2]] self.assertListEqual(Rules.borda(ranks), [0, 1, 2]) ranks = [[0, 1, 2], [2, 1, 0], [2, 1, 0]] self.assertListEqual(Rules.borda(ranks), [2, 1, 0])
def update(self, vote): self.ranks = Rules.borda(self.get_ranks()) self.updated = datetime.now() self.number_of_votes += 1 self.put()
def testBorda(self): ranks = [[0,1,2]] self.assertListEqual(Rules.borda(ranks), [0, 1, 2]) ranks = [[0,1,2], [2,1,0], [2,1,0]] self.assertListEqual(Rules.borda(ranks), [2, 1, 0])